Here you can find the source of getKey(byte[] arrayBytesTemp)
private static Key getKey(byte[] arrayBytesTemp)
//package com.java2s; /*//from w w w . j a va 2 s. c om * Copyright (c) 2007 IJO Technologies Ltd. * www.ijotechnologies.com * All rights reserved. * * This software is the confidential and proprietary information of * IJO Technologies ("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you * entered into with IJO Technologies. */ import javax.crypto.spec.SecretKeySpec; import java.security.Key; public class Main { private static String DEFAULT_ALGORITHM_NAME = "DES"; private static Key getKey(byte[] arrayBytesTemp) { byte[] bytesTemp = new byte[8]; int len = arrayBytesTemp.length < bytesTemp.length ? arrayBytesTemp.length : bytesTemp.length; for (int i = 0; i < len; i++) { bytesTemp[i] = arrayBytesTemp[i]; } Key key = new SecretKeySpec(bytesTemp, DEFAULT_ALGORITHM_NAME); return key; } }