Package com.poscoict.glueframework.util
Class GlueCipher
java.lang.Object
com.poscoict.glueframework.util.GlueCipher
파일/문자열 암복호화 클래스.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String문자열 대칭 복호화.static String복호화static voiddecryptFile(String infile, String outfile) 파일 대칭 복호화.static voiddecryptFile(String infile, String outfile, File key) static String주어진 문자열을 DEFAULT_KEY_FILE로 암호화.static String주어진 문자열을 주어진 Key 파일로 암호화.static voidencryptFile(String infile, String outfile) 파일 대칭 암호화.static voidencryptFile(String infile, String outfile, File key) static Filemakekey()Deprecated.static File주어진 파일명으로 Key 생성static voidreset()Deprecated.
-
Field Details
-
GLUE_CIPHER_FILE
- See Also:
-
DEFAULT_KEY_FILE
Deprecated.- See Also:
-
-
Constructor Details
-
GlueCipher
public GlueCipher()
-
-
Method Details
-
reset
Deprecated.새롭게 cipher 객체 생성 -
makekey
Deprecated.비밀키 생성메소드- Returns:
- void
- Throws:
IOExceptionNoSuchAlgorithmException
-
makekey
주어진 파일명으로 Key 생성- Parameters:
filename- 전체경로- Returns:
- key file
- Throws:
IOException- I/O ErrorNoSuchAlgorithmException- java security Error
-
encrypt
public static String encrypt(String unencryptedString) throws BadPaddingException, IllegalBlockSizeException 주어진 문자열을 DEFAULT_KEY_FILE로 암호화.- Parameters:
unencryptedString- 비밀키 암호화를 희망하는 문자열- Returns:
- 암호화된 문자열
- Throws:
BadPaddingExceptionIllegalBlockSizeException
-
encrypt
public static String encrypt(String unencryptedString, File key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, FileNotFoundException 주어진 문자열을 주어진 Key 파일로 암호화.- Parameters:
unencryptedString- 문자열key- 파일- Returns:
- 암호화된 문자열
- Throws:
NoSuchPaddingExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionBadPaddingExceptionIllegalBlockSizeExceptionFileNotFoundException
-
decrypt
public static String decrypt(String encryptedString) throws BadPaddingException, IllegalBlockSizeException 문자열 대칭 복호화.- Parameters:
encryptedString- 비밀키 복호화를 희망하는 문자열- Returns:
- String 복호화된 ID
- Throws:
BadPaddingExceptionIllegalBlockSizeException
-
decrypt
public static String decrypt(String encryptedString, File key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException 복호화- Parameters:
encryptedString- 복호화를 희망하는 문자열key- 비밀키- Returns:
- String 복호화된 문자열
- Throws:
NoSuchPaddingExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionBadPaddingExceptionIllegalBlockSizeException
-
encryptFile
파일 대칭 암호화.- Parameters:
infile- 암호화을 희망하는 파일명outfile- 암호화된 파일명- Throws:
IOException
-
encryptFile
public static void encryptFile(String infile, String outfile, File key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IOException - Parameters:
infile-outfile-key-- Throws:
NoSuchPaddingExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionIOException
-
decryptFile
파일 대칭 복호화.- Parameters:
infile- 복호화을 희망하는 파일명outfile- 복호화된 파일명- Throws:
IOException
-
decryptFile
public static void decryptFile(String infile, String outfile, File key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IOException
-