Re: SScrypto framework
Re: SScrypto framework
- Subject: Re: SScrypto framework
- From: Davide Scheriani <email@hidden>
- Date: Wed, 13 Feb 2008 16:31:01 +0100
Im using this framework to create an encrypted key then save into a
file.
The problem is not when I crypt,but when I decrypt.
I get this error: EVP_DecryptFinal() failed!
I use two selectors:
-(IBAction )generate:(id)sender{
NSString *password = [[tocrypt textStorage] string];
[crypto setClearTextWithString:password];
NSData *cipherText = [crypto encrypt:@"blowfish"];
[cipherText writeToFile:@"/Users/XYZ/Desktop/key.andrk"
atomically:YES];
NSLog(@"Now encrypted: %s",[cipherText bytes]);
}
-(IBAction )loadKey:(id)sender{
NSOpenPanel *oPanel = [[NSOpenPanel openPanel] retain];
[oPanel setTitle:@"Select a key file"];
[oPanel setPrompt:@"Choose"];
[oPanel setCanChooseDirectories:NO];
[oPanel setCanChooseFiles:YES];
[oPanel setAllowsMultipleSelection:NO];
[oPanel setResolvesAliases:NO];
if ([oPanel runModalForTypes: [NSArray arrayWithObjects: @"andrk",
nil]] == NSOKButton) {
NSArray *filesToOpen = [oPanel filenames];
NSString *aFile = [filesToOpen objectAtIndex:0];
NSData *onfly = [NSData dataWithContentsOfFile:aFile];
[crypto setCipherText:onfly];
NSData *decryptedTextData = [crypto decrypt:@"blowfish"];
[crypto release];
}
}
if I save the crypt string as NSData, then I reload it and set it
again as setCipherText:onfly, why it deosnt works?
It seems ots nott feed right with the external NSData.
tnx
who is using this framework? I need a small hand to solve a small
problem.
How about posting the actual problem you're having?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden