Last active
February 11, 2025 13:55
-
-
Save ardzz/5287638cca46920b0e413e2264bc4f42 to your computer and use it in GitHub Desktop.
Revisions
-
ardzz revised this gist
Feb 11, 2025 . 2 changed files with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def generate_hmac(key, message): return hashlib.sha256(key.encode() + message.encode()).hexdigest() data = {"name": "Reky", "email": "reky@cby0x1.id"} data_json = json.dumps(data) print("Data JSON:", data_json) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,6 @@ PUT /profile HTTP/1.1 Host: api.reky.id Content-Type: application/json Date: Tue, 11 Feb 2025 12:00:00 GMT Hmac: 63b840b5a5d3a4ea3c203571fa4489952aad23050056fc01391e24ef804b4c25 {"name": "Reky","email": "reky@cyb0x1.id"} -
ardzz created this gist
Feb 11, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ import hashlib import json def generate_hmac(key, message): return hashlib.sha256(key.encode() + message.encode()).hexdigest() data = {"name": "Reky", "email": "[email protected]"} data_json = json.dumps(data) print("Data JSON:", data_json) print("HMAC:", generate_hmac("very_secret", data_json)) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ PUT /profile HTTP/1.1 Host: api.reky.id Content-Type: application/json Date: Tue, 11 Feb 2025 12:00:00 GMT Hmac: 3a188613de0d4d402b7260a52998042f0d5774e2936c88bfb51d166c6de6b2fa {"name": "Reky","email": "[email protected]"}