Skip to content

Initialization vectors should be randomly generated for proper security guarantees.Β #76

@naskovai

Description

@naskovai

As part of some research about the common crypto mistakes that developers make, I noticed that your application has one of them.

In EncryptionUtil.getCipher you're initializing a Cipher instance with a static IV which is insecure.

One possible solution would be to generate the initialization vector using SecureRandom:

byte[] iv = new byte[16];
new SecureRandom().nextBytes(iv);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions