/** * 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. * */packagecom.ciwise.accounting.util;/** * @author <a href="mailto:david@ciwise.com">David L. Whitehurst</a> * */publicclassEncryptPropertyValue{publicstaticvoidmain(String[]args){byte[]encryptedBytes=AESCryptoUtil.encrypt("SomePropertyValueHere");StringhexByteString=CryptoUtil.toHex(encryptedBytes);System.out.println("Hexbytes are: "+hexByteString);byte[]encryptedBytesBack=CryptoUtil.hexStringToByteArray(hexByteString);Stringtmp=newString(AESCryptoUtil.decrypt(encryptedBytesBack));System.out.println("And, the initial string was: "+tmp);}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.