Member-only story
(Crypto) Roll-ups and Hash
Oops. That title looks a bit like clickbait for one of those dodgy social media posts. The roll-up I mean here are JavaScript code integrations of hashing methods for cryptography. In this case, we will use the JavaScript integrations provided by the Cloudflare rolls-up CDN repository for the crypto-js library [here]:
For this, allows us to simply integrate JavaScript code from the edge of the Cloud, and in a trustworthy way. As an example, let’s integrate HMAC, and where we have a signed hash of a message:
For this, Bob sends Alice a message, and takes a hash of it, such as using SHA-256, and then signs this with a shared secret key. The main hashing methods we use include MD-5, SHA-1 and SHA-256. Luckily, the roll-ups can be added with:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/hmac-md5.min.js"></script>
<script type="text/javascript"…