• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SScrypto framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: SScrypto framework
      • From: Jens Alfke <email@hidden>
References: 
 >SScrypto framework (From: Davide Scheriani <email@hidden>)
 >Re: SScrypto framework (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: fetching the window pointer of other applications (processes)
  • Next by Date: Mail-like grouping in NSTableView?
  • Previous by thread: Re: SScrypto framework
  • Next by thread: Re: SScrypto framework
  • Index(es):
    • Date
    • Thread