crypt [message #469642] |
Sat, 23 June 2012 06:52 ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/custom_avatars/3415.gif) |
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
I am not familiar at all with string encryption and decryption.
I have the following function:
void encrypt (char e[] )
{
for( int i=0; e[i] != '\0'; ++i )
{
++e[i];
}
}
void decrypt( char * ePtr )
{
for( ; * ePtr != '\0'; ++ ePtr )
{
--(* ePtr);
}
}
It's obviously completely pathetic.
Anyone care to improve this? Something that can boast of industry standard would be excellent.
[Updated on: Sat, 23 June 2012 09:19] Report message to a moderator
|
|
|
Re: crypt [message #469644 is a reply to message #469642] |
Sat, 23 June 2012 07:10 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
iRANian
Messages: 4307 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
What is it needed for? If you're releasing a binary people can just copy and paste the ASM for the encryption and decryption functions or hook them and have the output for them get logged to a console window.
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
|
|
|
|
|
|
Re: crypt [message #470643 is a reply to message #469723] |
Tue, 03 July 2012 10:41 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) |
![](/images/custom_avatars/21300.png) |
Jerad2142
Messages: 3808 Registered: July 2006 Location: USA
Karma: 6
|
General (3 Stars) |
|
|
If your just doing ascii encryption keep in mind that it's from 0 - 127. So if you exceed 127 you'll have to loop it down to 0. If you drop under 0 you have to loop it back around to 127. Otherwise when you save it you'll be left with nothing useful.
However, as danpaul88 said, Google is an excellent place to check out too, you can go and get any encryption algorithm off of there in open source pretty much (wiki usually has source with examples of the algorithms as well).
Visit Jerad's deer sweat shop
|
|
|