|
@@ -57,7 +57,6 @@ public class BootstrapSecurityUtil {
|
|
* @param secretKey
|
|
* @param secretKey
|
|
*/
|
|
*/
|
|
public static void decrypt(Properties props, String secretKey) {
|
|
public static void decrypt(Properties props, String secretKey) {
|
|
- AES aes = new AES(secretKey + RANDOM);
|
|
|
|
Map<String, String> map = Maps.newHashMap();
|
|
Map<String, String> map = Maps.newHashMap();
|
|
Set<String> set = Sets.newHashSet();
|
|
Set<String> set = Sets.newHashSet();
|
|
for (Entry<Object, Object> entry : props.entrySet()) {
|
|
for (Entry<Object, Object> entry : props.entrySet()) {
|
|
@@ -65,6 +64,7 @@ public class BootstrapSecurityUtil {
|
|
Object value = entry.getValue();
|
|
Object value = entry.getValue();
|
|
if (key instanceof String && value instanceof String) {
|
|
if (key instanceof String && value instanceof String) {
|
|
if (((String) key).startsWith(ENCRYPTED_HEAD)) {
|
|
if (((String) key).startsWith(ENCRYPTED_HEAD)) {
|
|
|
|
+ AES aes = new AES(secretKey + RANDOM);
|
|
String decryptedValue = aes.decrypt((String) value);
|
|
String decryptedValue = aes.decrypt((String) value);
|
|
String newKey = ((String) key).substring(ENCRYPTED_HEAD.length());
|
|
String newKey = ((String) key).substring(ENCRYPTED_HEAD.length());
|
|
map.put(newKey, decryptedValue);
|
|
map.put(newKey, decryptedValue);
|
|
@@ -90,13 +90,13 @@ public class BootstrapSecurityUtil {
|
|
* @param secretKey
|
|
* @param secretKey
|
|
*/
|
|
*/
|
|
public static void decrypt(Map<String, String> props, String secretKey) {
|
|
public static void decrypt(Map<String, String> props, String secretKey) {
|
|
- AES aes = new AES(secretKey + RANDOM);
|
|
|
|
Map<String, String> map = Maps.newHashMap();
|
|
Map<String, String> map = Maps.newHashMap();
|
|
Set<String> set = Sets.newHashSet();
|
|
Set<String> set = Sets.newHashSet();
|
|
for (Entry<String, String> entry : props.entrySet()) {
|
|
for (Entry<String, String> entry : props.entrySet()) {
|
|
String key = entry.getKey();
|
|
String key = entry.getKey();
|
|
String value = entry.getValue();
|
|
String value = entry.getValue();
|
|
if (key.startsWith(ENCRYPTED_HEAD)) {
|
|
if (key.startsWith(ENCRYPTED_HEAD)) {
|
|
|
|
+ AES aes = new AES(secretKey + RANDOM);
|
|
String decrypted = aes.decrypt((String) value);
|
|
String decrypted = aes.decrypt((String) value);
|
|
map.put(key.substring(ENCRYPTED_HEAD.length() + 1), decrypted);
|
|
map.put(key.substring(ENCRYPTED_HEAD.length() + 1), decrypted);
|
|
set.add(key);
|
|
set.add(key);
|