정미나닷컴

[Java] 자바 데이터 암호화 본문

programming

[Java] 자바 데이터 암호화

정미나 2010. 10. 11. 16:35
반응형

import javax.crypto.Cipher;
→ 데이터를 암호화하고 복호화하는 기본 엔진

getInstance(): 암호화 모드를 설정하여 그 객체를 생성
init(): 암호화, 복호화 설정과 key 설정
doFinal(): 결과값 return


☞ 주요 메소드

static Cipher getInstance(String transformation) Returns a Cipher object that implements the specified transformation
void init(int opmode, Key key) Initializes this cipher with a key
void init(int opmode, Key key, AlgorithmParameterSpec params) Initializes this cipher with a key and a set of algorithm parameters
byte[] doFinal(byte[] input) Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation
getInstance() 메소드 인자로 "알고리즘/모드/패딩" 형태의 String 객체를 사용

- 사용되는 알고리즘:
AES, AESWrap, ARCFOUR, Blowfish, DES, DESede, DESedeWrap, ECIES, RC2, RC4, RC5, RSA 또는
PBEWith<digest>And<encryption>, PBEWith<prf>And<encryption> 형태

- 사용되는 모드:
NONE, CBC, CFB, CFBx, CTR, CTS, ECB, OFB, OFBx, PCBC

- 사용되는 패딩:
NoPadding, ISO10126Padding, OAEPPadding, PKCS1Padding, PKCS5Padding, SSL3Padding 또는 OAEPWith<digest>And<mgf>Padding 형태

반응형