AKushWarrior / steel_crypt

A collection of high-level API's exposing PointyCastle to perform hashing and encrypting in popular/secure algorithms.
https://pub.dev/packages/steel_crypt
Mozilla Public License 2.0
40 stars 10 forks source link

Get iv automatically #33

Closed newdev8 closed 4 years ago

newdev8 commented 4 years ago

In PHP I use open_ssl to encrypt a file with AES256 CBC and the PKCS7 Padding. The function automatically puts the iv on the start of the file for each block. Is there a way to get it automatically on the dart side?

In total there can be like 20 iv's or so. How do I make your function AesCrypt.decrypt get automatically the iv for each block?

AKushWarrior commented 4 years ago

No way to get it automatically, I'm afraid.

When steel_crypt 2.0 is done, I can write up a parsing utility for you. Just give me an example encrypted file.

newdev8 commented 4 years ago

You want an encrypted file alone or you want me to show you my php function?

AKushWarrior commented 4 years ago

Just the encrypted file (as a String). Bonus if you can show me where the iv is (section of the file String).

newdev8 commented 4 years ago

I ended up using just one IV for simplicity, thanks anyways for the proposal of the utility.

AKushWarrior commented 4 years ago

DON'T DO THAT! Using just one IV will compromise the security of the entire system!

Edit: Overreaction, sorry. Are you using the one key as well? Because then it really is very insecure.

newdev8 commented 4 years ago

No sorry, I din't mean literally just ONE iv, I meant the one your system provides, but also with your encryption functions.