7
7
import java .io .OutputStream ;
8
8
import java .security .SecureRandom ;
9
9
import java .util .Date ;
10
- import java .util .Iterator ;
11
10
12
11
import org .bouncycastle .bcpg .ArmoredInputStream ;
13
12
import org .bouncycastle .bcpg .ArmoredOutputStream ;
14
- import org .bouncycastle .bcpg .BCPGInputStream ;
15
13
import org .bouncycastle .bcpg .BCPGOutputStream ;
16
- import org .bouncycastle .bcpg .HashAlgorithmTags ;
17
14
import org .bouncycastle .bcpg .S2K ;
18
15
import org .bouncycastle .bcpg .SymmetricKeyAlgorithmTags ;
19
- import org .bouncycastle .bcpg .SymmetricKeyEncSessionPacket ;
20
- import org .bouncycastle .crypto .CryptoServicesRegistrar ;
21
16
import org .bouncycastle .openpgp .PGPEncryptedDataGenerator ;
22
17
import org .bouncycastle .openpgp .PGPEncryptedDataList ;
23
18
import org .bouncycastle .openpgp .PGPException ;
@@ -42,7 +37,7 @@ public class Argon2S2KTest
42
37
43
38
static final String TEST_MSG_PASSWORD = "password" ;
44
39
45
- // Test message from the crypto-refresh-05 document
40
+ // https://www.rfc-editor.org/rfc/rfc9580.html#name-v4-skesk-using-argon2-with-
46
41
static final String TEST_MSG_AES128 = "-----BEGIN PGP MESSAGE-----\n " +
47
42
"Comment: Encrypted using AES with 128-bit key\n " +
48
43
"Comment: Session key: 01FE16BBACFD1E7B78EF3B865187374F\n " +
@@ -53,7 +48,7 @@ public class Argon2S2KTest
53
48
"=uIks\n " +
54
49
"-----END PGP MESSAGE-----" ;
55
50
56
- // Test message from the crypto-refresh-05 document
51
+ // https://www.rfc-editor.org/rfc/rfc9580.html#name-v4-skesk-using-argon2-with-a
57
52
private static final String TEST_MSG_AES192 = "-----BEGIN PGP MESSAGE-----\n " +
58
53
"Comment: Encrypted using AES with 192-bit key\n " +
59
54
"Comment: Session key: 27006DAE68E509022CE45A14E569E91001C2955AF8DFE194\n " +
@@ -64,16 +59,16 @@ public class Argon2S2KTest
64
59
"=n8Ma\n " +
65
60
"-----END PGP MESSAGE-----" ;
66
61
67
- // Test message from the crypto-refresh-05 document
62
+ // https://www.rfc-editor.org/rfc/rfc9580.html#name-v4-skesk-using-argon2-with-ae
68
63
private static final String TEST_MSG_AES256 = "-----BEGIN PGP MESSAGE-----\n " +
69
- "Comment: Encrypted using AES with 192 -bit key\n " +
70
- "Comment: Session key: 27006DAE68E509022CE45A14E569E91001C2955AF8DFE194 \n " +
71
- " \n " +
72
- "wy8ECAThTKxHFTRZGKli3KNH4UP4AQQVhzLJ2va3FG8/pmpIPd/H/mdoVS5VBLLw \n " +
73
- "F9I+AdJ1Sw56PRYiKZjCvHg+2bnq02s33AJJoyBexBI4QKATFRkyez2gldJldRys \n " +
74
- "LVg77Mwwfgl2n/d572WciAM= \n " +
75
- "=n8Ma \n " +
76
- "-----END PGP MESSAGE-----" ;
64
+ "Comment: Encrypted using AES with 256 -bit key\n " +
65
+ "Comment: Session key: BBEDA55B9AAE63DAC45D4F49D89DACF4AF37FEF... \n " +
66
+ "Comment: Session key: ...C13BAB2F1F8E18FB74580D8B0 \n " +
67
+ " \n " +
68
+ "wzcECQS4eJUgIG/3mcaILEJFpmJ8AQQVnZ9l7KtagdClm9UaQ/Z6M/5roklSGpGu \n " +
69
+ "623YmaXezGj80j4B+Ku1sgTdJo87X1Wrup7l0wJypZls21Uwd67m9koF60eefH/K \n " +
70
+ "95D1usliXOEm8ayQJQmZrjf6K6v9PWwqMQ== \n " +
71
+ "-----END PGP MESSAGE-----" ;
77
72
78
73
static final String TEST_MSG_PLAIN = "Hello, world!" ;
79
74
0 commit comments