TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2015 |
Maintained by Gabriel Handford.
Depends on: | |
NAChloride | >= 0 |
NACrypto | >= 0 |
MPMessagePack | >= 0 |
GHODictionary | >= 0 |
Objective-C implementation for TripleSec.
TripleSec is a triple-paranoid symmetric encryption so that a failure in one or two ciphers won't compromise the data.
See gabriel/NAChloride for more details on crypto implementations used here.
pod "TSTripleSec"
#import <TSTripleSec/TSTripleSec.h>
NSError *error = nil;
NSData *message = [@"this is a secret message" dataUsingEncoding:NSUTF8StringEncoding];
NSData *key = [@"toomanysecrets" dataUsingEncoding:NSUTF8StringEncoding];
TSTripleSec *tripleSec = [[TSTripleSec alloc] init];
NSData *encrypted = [tripleSec encrypt:message key:key error:&error];
NSData *decrypted = [tripleSec decrypt:encrypted key:key error:&error];
P3SKB is a format for storing encrypted keys.
NSData *privateKey = ...;
NSData *publicKey = ...;
P3SKB *key = [P3SKB P3SKBWithPrivateKey:privateKey password:@"toomanysecrets" publicKey:publicKey error:&error];
// Create from serialized data
P3SKB *key = [P3SKB P3SKBFromData:keyData error:&error];