intymny pustka test (bajt [] dane) {
definitywny bajt [] sekret = nowy bajt [] {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
definitywny SecretKeySpec klucz = nowy SecretKeySpec (sekret, "AES");
definitywny Cipher encryptCipher = Cipher.getInstance ("AES/CBC/PKCS5Padding");
encryptCipher.init (Cipher.ENCRYPT_MODE, klucz);
definitywny bajt [] iv = encryptCipher.getIV ();
definitywny bajt [] utajniać = encryptCipher.doFinal (dane);
…
} |