Skip to content

Commit

Permalink
doc: updated AES example to use 8 character salt to reflect recent bu…
Browse files Browse the repository at this point in the history
…g fixes. fixes #43.

Signed-off-by: Yichun Zhang (agentzh) <[email protected]>
  • Loading branch information
dndx authored and agentzh committed Jul 10, 2017
1 parent 82ff0e3 commit 69df3dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ Synopsis
local aes = require "resty.aes"
local str = require "resty.string"
local aes_256_cbc_sha512x5 = aes:new("AKeyForAES-256-CBC",
"MySalt!", aes.cipher(256,"cbc"), aes.hash.sha512, 5)
"MySalt!!", aes.cipher(256,"cbc"), aes.hash.sha512, 5)
-- AES 256 CBC with 5 rounds of SHA-512 for the key
-- and a salt of "MySalt!"
-- and a salt of "MySalt!!"
-- Note: salt can be either nil or exactly 8 characters long
local encrypted = aes_256_cbc_sha512x5:encrypt("Really secret message!")
ngx.say("AES 256 CBC (SHA-512, salted) Encrypted HEX: ", str.to_hex(encrypted))
ngx.say("AES 256 CBC (SHA-512, salted) Decrypted: ",
Expand Down

0 comments on commit 69df3dc

Please sign in to comment.