* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import java.security.Provider;
import java.security.Provider.Service;
import java.security.Security;
import java.security.Provider;
import java.security.Provider.Service;
import java.security.Security;
/**
* The salt is used to initialize the PBE (password Based Encrpytion) algorithm.
*/
private static final byte[] DEFAULT_SALT = {
(byte) 0xc7, (byte) 0x73, (byte) 0x21, (byte) 0x8c, (byte) 0x7e, (byte) 0xc8, (byte) 0xee, (byte) 0x99
};
/**
* The salt is used to initialize the PBE (password Based Encrpytion) algorithm.
*/
private static final byte[] DEFAULT_SALT = {
(byte) 0xc7, (byte) 0x73, (byte) 0x21, (byte) 0x8c, (byte) 0x7e, (byte) 0xc8, (byte) 0xee, (byte) 0x99
};
-
- /**
- * The prefix we insert onto any data we encrypt so that we can tell if it is encrpyted later and therefore decrypt
- * it
- */
- @SuppressWarnings("nls")
- public static final String ENCRYPTED_VALUE_PREFIX = "enc:";
-
- /**
- * The instance of the encryption utility object
- */
- private static EncryptionTool instance = null;
-
+ /**
+ * The algorithm to encrypt and decrpyt data is "Password (or passphrase) Based Encryption with Message Digest #5
+ * and the Data Encryption Standard", i.e., PBEWithMD5AndDES.
+ */
+ @SuppressWarnings("nls")
+ private static final String SECURITY_ALGORITHM = "PBEWITHMD5AND256BITAES";// "PBEWithMD5AndDES";
+ /**
+ * The instance of the encryption utility object
+ */
+ private static EncryptionTool instance = null;
'b', '"', 'e', 'n', '{', '"', 'l', 'U', 'F', '+', 'E', '\'', 'R', 'T', 'p', '1', 'V', '4', 'l', 'a', '9', 'w',
'v', '5', 'Z', '#', 'i', 'V', '"', 'd', 'l', '!', 'L', 'M', 'g', 'L', 'Q', '{', 'v', 'v', 'K', 'V'
};
'b', '"', 'e', 'n', '{', '"', 'l', 'U', 'F', '+', 'E', '\'', 'R', 'T', 'p', '1', 'V', '4', 'l', 'a', '9', 'w',
'v', '5', 'Z', '#', 'i', 'V', '"', 'd', 'l', '!', 'L', 'M', 'g', 'L', 'Q', '{', 'v', 'v', 'K', 'V'
};
-
- /**
- * The algorithm to encrypt and decrpyt data is "Password (or passphrase) Based Encryption with Message Digest #5
- * and the Data Encryption Standard", i.e., PBEWithMD5AndDES.
- */
- @SuppressWarnings("nls")
- private static final String SECURITY_ALGORITHM = "PBEWITHMD5AND256BITAES";// "PBEWithMD5AndDES";
-
- * If the clear text is already encrypted, it is not encrypted again and is returned as is. Otherwise, the
- * clear text is encrypted and returned.
+ * If the clear text is already encrypted, it is not encrypted again and is returned as is. Otherwise, the clear
+ * text is encrypted and returned.
- * Is a value encrypted? A value is considered to be encrypted if it begins with the
- * {@linkplain #ENCRYPTED_VALUE_PREFIX encrypted value prefix}.
+ * Is a value encrypted? A value is considered to be encrypted if it begins with the {@linkplain
+ * #ENCRYPTED_VALUE_PREFIX encrypted value prefix}.
* XORs the input byte array with the secret key, padding 0x0 to the end of the secret key if the input is longer
* and returns a byte array the same size as input
*
* XORs the input byte array with the secret key, padding 0x0 to the end of the secret key if the input is longer
* and returns a byte array the same size as input
*