예제 #1
0
파일: DES.java 프로젝트: Slaan/itsec
 /**
  * Decrypt one block of data. The encrypted data is taken from <code>dest[i..i+7]</code> and
  * plaintext is written to <code>source[j..j+7]</code>.
  */
 public void decrypt(byte[] source, int i, byte[] dest, int j) {
   long block = makeLong(source, i, 8);
   block = pickBits(block, IP);
   block = subDecrypt(block);
   block = pickBits(block, FP);
   writeBytes(block, dest, j, 8);
 }
예제 #2
0
파일: DES.java 프로젝트: Slaan/itsec
 /** Return the key-bits for this key as an array of 8 bytes. */
 public byte[] getKey() {
   byte[] a = new byte[8];
   writeBytes(key, a, 0, 8);
   return a;
 }