High speed, public-key cryptography in JavaScript (part 2): Digital Signatures

“Digital Signatures provide a digital fingerprint that allows a recipient to authenticate the message sender and its integrity.”

The so called “Blockchain based Technologies” security is basically about digital signatures and hashes! — photo courtesy of https://pexels.com

Ed25519 signatures are elliptic-curve signatures, carefully engineered at several levels of design and implementation to achieve very high speeds without compromising security.

This system has a 2¹²⁸ security target; breaking it has similar difficulty to breaking NIST P-256, RSA with ~3000-bit keys, strong 128-bit block ciphers, etc. The best attacks known actually cost more than 2¹⁴⁰ bit operations on average, and degrade quadratically in success probability as the number of bit operations drops.


Generating signing key-pairs

Signing/Verifying messages

My two cents on usability

As in JavaScript client applications we usually tend to deal with base64 encoded keys and raw String messages, I decided contribute with an NPM package that abstracts the Uint8Array arrays manipulations:

Conclusions

That’s it!
Digital signatures in JavaScript made simple through TweetNaCL.js and nacl-signature.

Happy Hacking!

sharenowTech

SHARE NOW TECH Blog

Rolando Santamaria Maso

Written by

ENTHUSIASTIC AND PASSIONATE COMPUTER SCIENCES ENGINEER. CURRENTLY A NODE.JS CHAPTER LEAD AT SHARE-NOW, TECH LEAD AT DAIMLER AUTONOMOUS SERVICES....

sharenowTech

SHARE NOW TECH Blog

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade