How to use cbc mode in javascript using AES
I want to use CBC mode encryption for the message using AES algorithm (AES code is available) in javascript. How can this be done?
I am new to cryptography and javascript. Generating key & IV, padding, taking c开发者_C百科are of padding while decrypting are the issues to be handled. How to get started with this?I'd suggest you start by reading NIST: Recommendation for Block Cipher Modes of Operation.
It covers CBC, padding and how to generate IVs.
On a side-note:
You may want to start with Counter Mode (also covered in the recommendation). It's by far easier to understand and implement. You don't need any padding and you don't need a separate function for decryption. Encryption and decryption are basically the same thing in Counter Mode.
精彩评论