Skip to content

Commit

Permalink
Fix minor typo
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrosted committed Sep 10, 2018
1 parent 4571dba commit d6ca7d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions authenticated-encryption.js
Expand Up @@ -14,7 +14,7 @@ let order = {
"skus":["sku1","sku2","sku3"],
"tags":["tag1","tag2","tag3"]
};
let jsonSeralizedOrder = JSON.stringify(order);
let jsonSerializedOrder = JSON.stringify(order);

// When you get the keys from Trustpilot, they are base64 encoded, so first we need to decode them
let encryptionKey = Buffer.from(encryptionKeyBase64, 'base64');
Expand All @@ -25,7 +25,7 @@ let iv = crypto.randomBytes(16);

// Encrypt our order
let cipher = crypto.createCipheriv('aes-256-cbc', encryptionKey, iv);
let cipherText = Buffer.concat([cipher.update(jsonSeralizedOrder, 'utf8'), cipher.final()]);
let cipherText = Buffer.concat([cipher.update(jsonSerializedOrder, 'utf8'), cipher.final()]);

// Compute the HMAC
let hmac = crypto.createHmac('sha256', authenticationKey).update(Buffer.concat([iv, cipherText])).digest();
Expand Down

0 comments on commit d6ca7d8

Please sign in to comment.