3

私は Twofish 暗号化に取り組んでおり、以下のコードのようなものに取り組みました。
ただし、上記のエラーが発生しています。
ご検討いただき、必要に応じてアドバイスをお願いいたします。

SecureRandom sr= new SecureRandom(cipher_key.getBytes());
      KeyGenerator kg=KeyGenerator.getInstance("twofish");
      kg.init(sr);
      SecretKey sk = kg.generateKey();
      // create an instance of cipher
        Cipher cipher = Cipher.getInstance("twofish");

        // initialize the cipher with the key
        cipher.init(Cipher.ENCRYPT_MODE, sk);

        // enctypt!
        encrypted = cipher.doFinal(word.getBytes());
4

0 に答える 0