-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
IV
Y coodinate's SHA256 hash will be the 256 bit IV for the AES256 block cipher.
- AES-256 has 128 bit blocks, so the IV is at most 128 bits. Rijndael supports 256 bit blocks, but that's no longer AES. So either you're not using AES, or you're not using a 256 bit IV.
- Using the Y coordinate of the shared secret is a bit annoying, sometimes it's convenient to only compute the X coordinate. IVs aren't secret either, so you can just as easily choose a random one and store it in front of the message
- You don't need an IV in the first place if you have single-use 256 bit keys.
Unspecified mode
You also forgot to specify which mode you use for encryption. ECB, CBC, CTR etc.
No MAC
Without a MAC, your data isn't protected against an active attacker. This is surprisingly dangerous, for example it enables padding oracle attacks.
Use a MAC, either as part of an existing authenticated encryption scheme, or as part of an encrypt-then-mac scheme (not the other way round!). MAC verification must be constant time, else you'll enable timing attacks.
Metadata
Metadata
Assignees
Labels
No labels