encryption problems
encryption problems
- Subject: encryption problems
- From: email@hidden
- Date: Thu, 17 Jul 2003 22:46:47 -0400
this is more of a C question than a cocoa question, but I figured
someone out here would know the answer since it's all under the
umbrella of programming.
anyway, i'm trying to add encryption to a simple little application of
mine, but i'm having some problems with it. the main one is that one
specific message is not decrypting correctly. problem is that if i make
an identical encrypted string, it decrypts fine. so, two identical
strings are decrypting differently. i'm posting here since it has to be
something i'm doing, not the encryption algorithm.
char decryptedString[1024]="",encryptedString[1024]="";
memset((void *) decryptedString, 0, 1024);
memset((void *) encryptedString, 0, 1024);
sprintf(encryptedString,"%s",[[eachData objectAtIndex:i] cString]);
char *original=NewPtrClear(1024);
char *encrypted=NewPtrClear(1024);
char *decrypted=NewPtrClear(1024);
sprintf(original,"%s","0061\tPRoToTyPe");
[self encrypt:original andResult:encrypted];
if(strcmp(encrypted,encryptedString)==0) {
[self decrypt:encryptedString andResult:decrypted]; /* if I make this
decrypt "encrypted", it decrypts fine */
printf("match! decrypted - %s\n",decrypted);
}
[self decrypt:encryptedString andResult:decryptedString];
NSLog(@"received %s",decryptedString);
I know i didn't give a lot of information, but does anyone have any
ideas as to what the problem could be?
chris struhar
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.