File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
src/main/java/cryptography Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
package cryptography ;
2
2
3
- import javax .crypto .Cipher ;
4
- import java .security .SecureRandom ;
3
+ import javax .crypto .*;
5
4
import javax .crypto .spec .GCMParameterSpec ;
6
- import javax .crypto .SecretKey ;
7
-
8
- import java .security .NoSuchAlgorithmException ;
9
- import java .security .InvalidKeyException ;
10
- import javax .crypto .IllegalBlockSizeException ;
11
- import javax .crypto .NoSuchPaddingException ;
12
5
import java .security .InvalidAlgorithmParameterException ;
13
- import javax .crypto .BadPaddingException ;
6
+ import java .security .InvalidKeyException ;
7
+ import java .security .NoSuchAlgorithmException ;
8
+ import java .security .SecureRandom ;
14
9
15
10
/**
16
11
This class securely performs AES encryption in GCM mode, with 256 bits key size.
17
12
*/
18
13
public class SecuredGCMUsage {
19
14
20
- public static int AES_KEY_SIZE = 256 ;
15
+ static int AES_KEY_SIZE = 256 ;
21
16
public static int IV_SIZE = 96 ;
22
17
public static int TAG_BIT_LENGTH = 128 ;
23
- public static String ALGO_TRANSFORMATION_STRING = "AES/GCM/PKCS5Padding" ;
18
+ private static String ALGO_TRANSFORMATION_STRING = "AES/GCM/PKCS5Padding" ;
24
19
25
20
/**
26
21
* Attempts to encrypt the {@code message} with a symmetric encryption technique
You can’t perform that action at this time.
0 commit comments