Class McElieceCipher

  • All Implemented Interfaces:
    MessageEncryptor

    public class McElieceCipher
    extends java.lang.Object
    implements MessageEncryptor
    This class implements the McEliece Public Key cryptosystem (McEliecePKCS). It was first described in R.J. McEliece, "A public key cryptosystem based on algebraic coding theory", DSN progress report, 42-44:114-116, 1978. The McEliecePKCS is the first cryptosystem which is based on error correcting codes. The trapdoor for the McEliece cryptosystem using Goppa codes is the knowledge of the Goppa polynomial used to generate the code.
    • Field Detail

      • OID

        public static final java.lang.String OID
        The OID of the algorithm.
        See Also:
        Constant Field Values
      • maxPlainTextSize

        public int maxPlainTextSize
      • cipherTextSize

        public int cipherTextSize
    • Constructor Detail

      • McElieceCipher

        public McElieceCipher()
    • Method Detail

      • init

        public void init​(boolean forEncryption,
                         CipherParameters param)
        Specified by:
        init in interface MessageEncryptor
        Parameters:
        forEncryption - true if we are encrypting a signature, false otherwise.
        param - key parameters for encryption or decryption.
      • getKeySize

        public int getKeySize​(McElieceKeyParameters key)
        Return the key size of the given key object.
        Parameters:
        key - the McElieceKeyParameters object
        Returns:
        the keysize of the given key object
      • messageEncrypt

        public byte[] messageEncrypt​(byte[] input)
        Encrypt a plain text.
        Specified by:
        messageEncrypt in interface MessageEncryptor
        Parameters:
        input - the plain text
        Returns:
        the cipher text