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

Cryptographic API misuse detected #47

Open
anam-dodhy opened this issue Nov 12, 2018 · 0 comments
Open

Cryptographic API misuse detected #47

anam-dodhy opened this issue Nov 12, 2018 · 0 comments

Comments

@anam-dodhy
Copy link

Hi, I am currently looking into projects on github which are parametrically misusing cryptographic APIs for my research and I came across a few instances in your project where I found such misuses. These misuses have been highlighted in research papers such as

In your source code file AESUtils.java there are two functions encrypt(String, String) and decrypt(String, String). Following issues have been found in these two functions:

  • In function encrypt(String, String) At line 27
SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");

and at line 26

IvParameterSpec iv = new IvParameterSpec(INIT_VECTOR.getBytes("UTF-8"));

First parameters were not properly randomized in both cases. They should be randomized using java.security.SecureRandom class. And these ill prepared skeySpec and iv are later passed on as paramters in line 30 which results in another misuse.

  • In function decrypt(String, String) same issues as explained above are found at line 49, 50 and 53.

  • In another file PasswordProvider.java at line 42

MessageDigest md = MessageDigest.getInstance("MD5");

First parameter (with value "MD5") should be any of {SHA-256, SHA-384, SHA-512} as MD5 is widely known to be an insecure algorithm now.

I believe fixing these issues would help your product be more secure.

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