Class Xtea


  • public class Xtea
    extends java.lang.Object
    Implements the XTEA algorithm.
    • Constructor Summary

      Constructors 
      Constructor Description
      Xtea​(byte @NotNull [] key)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void decrypt​(byte @NotNull [] ciphertext, byte @NotNull [] plaintext)
      Decrypts a data block.
      void encrypt​(byte @NotNull [] plaintext, byte @NotNull [] ciphertext)
      Encrypts a data block.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Xtea

        public Xtea​(byte @NotNull [] key)
        Creates a new instance.
        Parameters:
        key - the key to use; must be 16 bytes
    • Method Detail

      • encrypt

        public void encrypt​(byte @NotNull [] plaintext,
                            byte @NotNull [] ciphertext)
        Encrypts a data block.
        Parameters:
        plaintext - the block to encrypt; must be 8 bytes
        ciphertext - the encrypted block; must be 8 bytes
      • decrypt

        public void decrypt​(byte @NotNull [] ciphertext,
                            byte @NotNull [] plaintext)
        Decrypts a data block.
        Parameters:
        ciphertext - the block to decrypt; must be 8 bytes
        plaintext - the decrypted block; must be 8 bytes