IssacSE
Objective-C
@interface IssacSE : NSObject
Swift
class IssacSE : NSObject
대칭키 암복호화 관련 기능
-
랜덤값(의사난수배열)을 생성한다.
Declaration
Objective-C
+ (nullable NSMutableData *)makeRandom:(int)randomLen;Swift
class func makeRandom(_ randomLen: Int32) -> NSMutableData?Parameters
randomLen생성할 랜덤값의 크기
-
입력된 값들을 기반으로 키를 생성(유도)한다. (PKCS#12 v1.0 Appendix. B)
Declaration
Objective-C
+ (nullable NSMutableData *)deriveKeyPkcs12:(int)keyLen pin:(nonnull NSString *)pin derivedKeyUsage:(DerivedKeyUsage)derivedKeyUsage salt:(nonnull NSData *)salt iteration:(int)iteration hashAlg:(HashAlg)hashAlg;Swift
class func deriveKeyPkcs12(_ keyLen: Int32, pin: String, derivedKeyUsage: DerivedKeyUsage, salt: Data, iteration: Int32, hashAlg: HashAlg) -> NSMutableData?Parameters
keyLen생성할 키의 길이 (bytes)
pin키 생성에 사용할 PIN
derivedKeyUsage키의 용도
saltsalt (표준 참고)
iterationiterations (표준 참고)
hashAlg키 유도 과정에 사용되는 해시 알고리즘
-
입력된 값들을 기반으로 키를 생성(유도)한다. (PKCS#5 - PBKDF2)
Declaration
Objective-C
+ (nullable NSMutableData *)deriveKeyPbkdf2:(int)keyLen pin:(nonnull NSString *)pin salt:(nonnull NSData *)salt iteration:(int)iteration hashAlg:(HashAlg)hashAlg;Swift
class func deriveKeyPbkdf2(_ keyLen: Int32, pin: String, salt: Data, iteration: Int32, hashAlg: HashAlg) -> NSMutableData?Parameters
keyLen생성할 키의 길이 (bytes)
pin키 생성에 사용할 PIN
saltsalt (표준 참고)
iterationiterations (표준 참고)
hashAlg키 유도 과정에 사용되는 해시 알고리즘
-
입력한 원문을 CCM/GCM 방식으로 암호화한다.
Declaration
Objective-C
- (nullable NSData *)encrypt:(nonnull NSData *)plaintext authData:(nonnull NSData *)authData iv:(nonnull NSData *)iv tagLen:(int)tagLen;Swift
func encrypt(_ plaintext: Data, authData: Data, iv: Data, tagLen: Int32) -> Data?Parameters
plaintext암호화 대상 원문
authDataCCM/GCM의 추가 데이터
ivGCM의 iv, CCM의 nonce [CCM : 7 ≤ nonceLen ≤ 13, GCM : 12 ≤ ivLen]
tagLen메시지 인증 태그의 길이 [CCM : 4 ≤ tagLen ≤ 16, GCM : tagLen ≤ 16]
-
입력한 암호문을 CCM/GCM 방식으로 복호화한다.
Declaration
Objective-C
- (nullable NSMutableData *)decrypt:(nonnull NSData *)ciphertext authData:(nonnull NSData *)authData iv:(nonnull NSData *)iv tagLen:(int)tagLen;Swift
func decrypt(_ ciphertext: Data, authData: Data, iv: Data, tagLen: Int32) -> NSMutableData?Parameters
ciphertext암호문
authDataCCM/GCM의 추가 데이터
ivGCM의 iv, CCM의 nonce [CCM : 7 ≤ ivLen ≤ 13, GCM : 12 ≤ ivLen]
tagLen메시지 인증 태그의 길이 [CCM : 4 ≤ tagLen ≤ 16, GCM : tagLen ≤ 16]
IssacSE Class Reference