Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AES256CBC independant of class variables. #32

Open
metalurgical opened this issue Dec 1, 2023 · 0 comments
Open

Make AES256CBC independant of class variables. #32

metalurgical opened this issue Dec 1, 2023 · 0 comments

Comments

@metalurgical
Copy link

The variables defined here are a code smell:

private byte[] AES_ENCRYPTION_KEY;
private byte[] ENCRYPTION_IV;
private byte[] MAC_KEY;
private byte[] ENCRYPTION_EPHEM_KEY;

They should rather be passed in as parameters to the relevant functions. This way an instance of this class is reusable for all encrypt and decrypt operations and no additional cognitive overhead is needed to keep track of which instance contains what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant