Class IceCrypto

java.lang.Object
org.netxms.base.IceCrypto

public class IceCrypto extends Object
ICE encryption algorithm implementation
  • Constructor Summary

    Constructors
    Constructor
    Description
    IceCrypto(int level)
    Create a new ICE key with the specified level.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the block size, in bytes.
    void
    Clear the key schedule to prevent memory snooping.
    static byte[]
    decrypt(byte[] in, byte[] key)
    Encrypt data using given key.
    void
    decryptBlock(byte[] ciphertext, byte[] plaintext)
    Decrypt a block of 8 bytes of data.
    static byte[]
    encrypt(byte[] in, byte[] key)
    Encrypt data using given key.
    void
    encryptBlock(byte[] plaintext, byte[] ciphertext)
    Encrypt a block of 8 bytes of data.
    int
    Return the key size, in bytes.
    void
    set(byte[] key)
    Set the key schedule of an ICE key.

    Methods inherited from class java.lang.Object

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

    • IceCrypto

      public IceCrypto(int level)
      Create a new ICE key with the specified level.
      Parameters:
      level - key level
  • Method Details

    • set

      public void set(byte[] key)
      Set the key schedule of an ICE key.
      Parameters:
      key - new key
    • clear

      public void clear()
      Clear the key schedule to prevent memory snooping.
    • encryptBlock

      public void encryptBlock(byte[] plaintext, byte[] ciphertext)
      Encrypt a block of 8 bytes of data.
      Parameters:
      plaintext - unencrypted data
      ciphertext - buffer for encrypted data
    • decryptBlock

      public void decryptBlock(byte[] ciphertext, byte[] plaintext)
      Decrypt a block of 8 bytes of data.
      Parameters:
      ciphertext - encrypted data
      plaintext - buffer for decrypted data
    • keySize

      public int keySize()
      Return the key size, in bytes.
      Returns:
      key size in bytes
    • blockSize

      public int blockSize()
      Return the block size, in bytes.
      Returns:
      block size in bytes
    • encrypt

      public static byte[] encrypt(byte[] in, byte[] key)
      Encrypt data using given key.
      Parameters:
      in - clear text data
      key - encryption key
      Returns:
      encrypted data
    • decrypt

      public static byte[] decrypt(byte[] in, byte[] key)
      Encrypt data using given key.
      Parameters:
      in - encrypted data
      key - encryption key
      Returns:
      clear text data