Use scrypt for password-based key derivation.

This commit is contained in:
akwizgran
2018-01-12 15:52:41 +00:00
parent 3e55be8a82
commit 6bdb099aa9
21 changed files with 215 additions and 121 deletions

View File

@@ -1,8 +1,13 @@
package org.briarproject.bramble.api.crypto;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import javax.annotation.Nullable;
@NotNullByDefault
public interface CryptoComponent {
SecretKey generateSecretKey();
@@ -124,6 +129,7 @@ public interface CryptoComponent {
* given password. Returns null if the ciphertext cannot be decrypted and
* authenticated (for example, if the password is wrong).
*/
@Nullable
byte[] decryptWithPassword(byte[] ciphertext, String password);
/**