File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,16 @@ Synopsis
158158 ngx .say (" AES 256 CBC (SHA-512, salted) Encrypted HEX: " , str .to_hex (encrypted ))
159159 ngx .say (" AES 256 CBC (SHA-512, salted) Decrypted: " ,
160160 aes_256_cbc_sha512x5 :decrypt (encrypted ))
161+
162+ local aes = require " resty.aes"
163+ local str = require " resty.string"
164+ local aes_128_cbc_with_iv = assert (aes :new (" 1234567890123456" ,
165+ nil , aes .cipher (128 ," cbc" ), {iv = " 1234567890123456" }))
166+ -- AES 128 CBC with IV and no SALT
167+ local encrypted = aes_128_cbc_with_iv :encrypt (" Really secret message!" )
168+ ngx .say (" AES 128 CBC (WITH IV) Encrypted HEX: " , str .to_hex (encrypted ))
169+ ngx .say (" AES 128 CBC (WITH IV) Decrypted: " ,
170+ aes_128_cbc_with_iv :decrypt (encrypted ))
161171```
162172
163173[ Back to TOC] ( #table-of-contents )
You can’t perform that action at this time.
0 commit comments