Created
March 2, 2017 06:45
-
-
Save dlwhitehurst/16f6f87a2a33176010eeedf348f7f658 to your computer and use it in GitHub Desktop.
Class to Encrypt Property Values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) CI Wise Inc. All rights reserved. http://www.ciwise.com | |
* The software in this package is published under the terms of the Apache | |
* version 2.0 license, a copy of which has been included with this distribution | |
* in the LICENSE.txt file. | |
* | |
*/ | |
package com.ciwise.accounting.util; | |
/** | |
* @author <a href="mailto:[email protected]">David L. Whitehurst</a> | |
* | |
*/ | |
public class EncryptPropertyValue { | |
// public static void main(String[] args) { | |
// byte[] encryptedBytes = AESCryptoUtil.encrypt("supercalifragilisticexpialidocious"); | |
// String hexByteString = CryptoUtil.toHex(encryptedBytes); | |
// | |
// System.out.println("Hexbytes are: " + hexByteString); | |
// | |
// // Back again | |
// byte[] encryptedBytesBack = CryptoUtil.hexStringToByteArray(hexByteString); | |
// if (encryptedBytesBack == encryptedBytes) { | |
// System.out.println("All good here!"); | |
// } | |
// String tmp = new String(AESCryptoUtil.decrypt(encryptedBytesBack)); | |
// System.out.println("And, the initial string was: " + tmp); | |
// | |
// String tmp2 = new String(AESCryptoUtil.decrypt(CryptoUtil.hexStringToByteArray("1e438613340f991ab8b98a1b0a2f4b987678fd8daab4ee244bebcfef5b6aa2952962cadd19e69d36d8bfb2a566e99ffe"))); | |
// System.out.println(tmp2); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment