LeftyBC / weechancrypt

Python plugin for Weechat that allows encrypted messaging in an IRC channel via pre-shared key.
3 stars 1 forks source link

Use scrypt as the key derivation function #3

Open LeftyBC opened 9 years ago

LeftyBC commented 9 years ago

Currently we use PBKDF2 to derive the AES key for encryption/decryption.

A better alternative would be scrypt, or the HKDF from whatever HMAC function we end up choosing.

kisom commented 9 years ago

It might be useful to have scrypt give you the the 48 bytes you need for AES-256-CTR with HMAC-SHA-256, or just 32 bytes for AES-256-GCM.

LeftyBC commented 9 years ago

Will CTR mode work for multiparty systems? Would all parties need to agree on the counter, or is it stored within the message somehow?

kisom commented 9 years ago

With CTR you generally generate a random counter that you can prepend to the message (inside the MAC). This does add 16 bytes of overhead, but it's the most robust way.