mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 16:45:57 +03:00
[GH-ISSUE #794] Add Support for creating HmacSHA256 hashes #790
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#790
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nilayp on GitHub (Feb 19, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/794
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
2.1.8
macOS Version? (Ex. mac 10.14)
10.15.17
Crypto-js supports creating Hmac256 and other keyed hashes. To use it (or the wide variety of HMAC hashes that can be done with Crypto-js, you just need to add a wrapper in the @addons/Crypto.js file. (~/Library/Application Support/com.proxyman.NSProxy/addons)
I added a constant declaration and an export like this:
And it worked great. It sure would be nice to have this included in future versions.
@NghiaTranUIT commented on GitHub (Feb 20, 2021):
Thanks @nilayp I will add it to the next release 😄
@NghiaTranUIT commented on GitHub (Feb 20, 2021):
Added in this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.18.0_Add_HmacSHA256.dmg
Changelogs
Notes
~/Library/Application Support/com.proxyman.NSProxy/addons/CryptoJS.jsand relaunch the Beta build (This will be automatically done if I bump a new version in the next release, but for now, please do it manually 😄 )@nilayp commented on GitHub (Feb 20, 2021):
Unfortunately, your implementation didn't work because you returned a String.
The algorithm (implemented in node.js) used by AWS for signing keys is here (See code sample called "getSignatureKey"): https://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-javascript
My reimplementation of this in Proxyman scripting is below. Notice that this algorithm requires the byte array for each operation and then returns a byte array to the caller, which is also expecting a byte array. My converting each operation's output to a String, the computed signature is incorrect.
Once again, thanks for the quick effort. :)
@NghiaTranUIT commented on GitHub (Feb 21, 2021):
Ah, I understand. I will use your version 👍
@NghiaTranUIT commented on GitHub (Feb 21, 2021):
The final beta here: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.18.0_HmacSHA256_v2.dmg
Thank you for your contribution 🎉