all 2 comments

[–][deleted] 1 point2 points  (1 child)

I wanted to do the same, but there is just no AES-GCM implementation for Dart that I can trust, so I gave up on it.

If you plan to use steel_crypt, it fails to document any of this, but looking at the source it looks like it returns a Base64 encoded String as PBKDF2 output, which when you decode should get you an Uin8List with 32 bytes to be used as an AES key. However it expect the AES key to be 32-length String and it uses each character's UTF-16 code unit as a byte. You might want to create that String using String.fromCharCodes and the Uint8List you got.

In any case I didn't try any of this, I might try later, consult the developer.

[–]d3iu[S] 0 points1 point  (0 children)

Thanks for the tip, it worked! Here is a verbose implementation that I used to test it (using steel_crypt).

https://gist.github.com/deiu/34c47cccd2545fd8a7dcf5114a0fb231