1
1
/*
2
- * Copyright 2011-2016 the original author or authors.
2
+ * Copyright 2011-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class Encryptors {
32
32
* (Password-Based Key Derivation Function #2). Salts the password to prevent
33
33
* dictionary attacks against the key. The provided salt is expected to be
34
34
* hex-encoded; it should be random and at least 8 bytes in length. Also applies a
35
- * random 16 byte initialization vector to ensure each encrypted message will be
35
+ * random 16- byte initialization vector to ensure each encrypted message will be
36
36
* unique. Requires Java 6.
37
37
*
38
38
* @param password the password used to generate the encryptor's secret key; should
@@ -50,7 +50,7 @@ public static BytesEncryptor stronger(CharSequence password, CharSequence salt)
50
50
* Derives the secret key using PKCS #5's PBKDF2 (Password-Based Key Derivation
51
51
* Function #2). Salts the password to prevent dictionary attacks against the key. The
52
52
* provided salt is expected to be hex-encoded; it should be random and at least 8
53
- * bytes in length. Also applies a random 16 byte initialization vector to ensure each
53
+ * bytes in length. Also applies a random 16- byte initialization vector to ensure each
54
54
* encrypted message will be unique. Requires Java 6.
55
55
* NOTE: This mode is not
56
56
* <a href="https://en.wikipedia.org/wiki/Authenticated_encryption">authenticated</a>
@@ -63,7 +63,7 @@ public static BytesEncryptor stronger(CharSequence password, CharSequence salt)
63
63
* @param salt a hex-encoded, random, site-global salt value to use to generate the
64
64
* key
65
65
*
66
- * @see #stronger(CharSequence, CharSequence) which uses the significatly more secure
66
+ * @see #stronger(CharSequence, CharSequence), which uses the significatly more secure
67
67
* GCM (instead of CBC)
68
68
*/
69
69
public static BytesEncryptor standard (CharSequence password , CharSequence salt ) {
@@ -105,7 +105,10 @@ public static TextEncryptor text(CharSequence password, CharSequence salt) {
105
105
* not be shared
106
106
* @param salt a hex-encoded, random, site-global salt value to use to generate the
107
107
* secret key
108
+ * @deprecated This encryptor is not secure. Instead, look to your data store for a
109
+ * mechanism to query encrypted data.
108
110
*/
111
+ @ Deprecated
109
112
public static TextEncryptor queryableText (CharSequence password , CharSequence salt ) {
110
113
return new HexEncodingTextEncryptor (new AesBytesEncryptor (password .toString (),
111
114
salt ));
0 commit comments