Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SScrypto framework



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >SScrypto framework (From: Davide Scheriani <email@hidden>)
 >Re: SScrypto framework (From: "I. Savant" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.