rfc4648.js | Pure Javascript implementations of all RFC4648 data
kandi X-RAY | rfc4648.js Summary
kandi X-RAY | rfc4648.js Summary
This library implements encoding and decoding for the data formats specified in rfc4648:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rfc4648.js
rfc4648.js Key Features
rfc4648.js Examples and Code Snippets
Community Discussions
Trending Discussions on rfc4648.js
QUESTION
I am signing SHA512 hash with RSA and save it to file. The hash is the same on both python and javascript, but signature can not be verified. Python code:
...ANSWER
Answered 2019-Oct-01 at 18:24The sign
/verify
implementation in the Python-code doesn't perform hashing automatically, i.e. the user must explicitly hash the data before signing. During verification, the user must therefore verify the signature against the hash of the data.
The sign
/verify
implementation in the JavaScript-code performs hashing automatically, i.e. the user must not hash the data before signing. During verification, the user must therefore verify the signature against the data (and not against the hash of the data). The hash algorithm is specified in the key i.e. in generateKey
/importKey
using {hash: 'hash-algorithm'}.
The error in the posted JavaScript-code is caused by verifying the signature against the hash of the data. This is wrong. The signature must be checked against the data, i.e. in the JavaScript-code the following lines:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rfc4648.js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page