Exemplo n.º 1
0
Arquivo: DES.java Projeto: 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);
 }
Exemplo n.º 2
0
Arquivo: DES.java Projeto: 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;
 }