/* * Created on 06.10.2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates
*/
/** * @author Jens * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates
*/
/** * This program generates a AES key, retrieves its raw bytes, and * then reinstantiates a AES key from the key bytes. * The reinstantiated key is used to initialize a AES cipher for * encryption and decryption.
*/
publicclass AES {
/** * Turns array of bytes into string * * @param buf Array of bytes to convert to hex string * @return Generated hex string
*/ publicstatic String asHex (byte buf[]) {
StringBuffer strbuf = new StringBuffer(buf.length * 2); int i;
for (i = 0; i < buf.length; i++) { if (((int) buf[i] & 0xff) < 0x10)
strbuf.append("0");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.