View Single Post
Old Oct 18th, 2005, 1:00 PM   #8
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
I realize that this isn't 1028 bit or anything, probably 3 bit at best... But it gets the job done. If more security is needed look into TrippleDES or something similar... but I gather this is for learning purposes.
Well, the 1024 in 1024-bit encryption schemes refers to the maximum size of the key for ciphering, and as such, the original method would be only 8-bit. 1024/8 = 128 bytes, which is the maximum key-size for a scheme that is of that 'strength'. However, key-size is not the only, nor even primary contributing factor of strength in an encryption algorithm, else we'd all be using 32768-bit ciphers or the like :p

This is a good thread and project for learning the basics of encryption, though; yes.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote