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

sha1 #394

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

sha1 #394

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class EnvelopeEncryptDecrypt {

private static final String ARTIFACT = "EnvelopeEncryptDecrypt";
private static final String VERSION = "1";
private static final String PUBKEY_DIGEST_ALGO = "SHA-1";
private static final String PUBKEY_DIGEST_ALGO = "SHA-256";
private static final String PKEY_MODE_PADDING = "ECB/PKCS1Padding";

private static final String CONTENT_KEY = "content";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void test1() throws Exception {
byte[] r = new byte[i];
random.nextBytes(r);
String password = new Base64(0).encodeToString(r);
String encoded = EnvelopePBE.encode("PBKDF2WithHmacSHA1", 256, 4000, null, password);
String encoded = EnvelopePBE.encode("PBEWithHmacSHA512AndAES_256", 256, 4000, null, password);
assertTrue(
EnvelopePBE.check(
encoded,
Expand Down Expand Up @@ -57,7 +57,7 @@ public void test2() throws Exception {
public void test3() throws Exception {
String password = "password";

assertNotEquals(EnvelopePBE.encode("PBKDF2WithHmacSHA1", 256, 4000, null, password),
EnvelopePBE.encode("PBKDF2WithHmacSHA1", 256, 4000, null, password));
assertNotEquals(EnvelopePBE.encode("PBEWithHmacSHA512AndAES_256", 256, 4000, null, password),
EnvelopePBE.encode("PBEWithHmacSHA512AndAES_256", 256, 4000, null, password));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Password can be specified in one of the following format:\n\
\ file:FILE - provide a password as 1st line of FILE.
pbe-encode.arg.algorithm.name = algorithm
pbe-encode.arg.algorithm.type = required_argument
pbe-encode.arg.algorithm.default = PBKDF2WithHmacSHA1
pbe-encode.arg.algorithm.default = PBEWithHmacSHA512AndAES_256
pbe-encode.arg.algorithm.metavar = ALGORITHM
pbe-encode.arg.algorithm.help = PBE algorithm, default: @CLI_PRM_DEFAULT@
pbe-encode.arg.key-size.name = key-size
Expand Down