Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » crypt
crypt [message #469642] Sat, 23 June 2012 06:52 Go to next message
reborn is currently offline  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 messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
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 #469649 is a reply to message #469642] Sat, 23 June 2012 08:09 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Xor encryption is simple but effective. Google it Wink

http://steamsignature.com/card/1/76561197975867233.png
Re: crypt [message #469652 is a reply to message #469649] Sat, 23 June 2012 09:21 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
iRANian wrote on Sat, 23 June 2012 10:10

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.


It would be in a released binary, yes.
I am storing a user name and password to a settings file, and storing it as plain text isn't acceptable.


danpaul88 wrote on Sat, 23 June 2012 11:09

Xor encryption is simple but effective. Google it Wink


Thank you.



Re: crypt [message #469723 is a reply to message #469642] Sun, 24 June 2012 14:11 Go to previous messageGo to next message
Sir Kane
Messages: 1701
Registered: March 2003
Location: Angerville
Karma: 0
General (1 Star)
Keep in mind that encrypting text will require you to save the result base64 or something else encoded, because encryption can result in 0 values.

Proud N9500 and proud N6270 user. Creator of the IEE libraries (original bhs.dll) and the RB series software.
http://n00bstories.com/image.fetch.php?id=1189992501http://www.n00bstories.com/image.fetch.php?id=1257492907
Re: crypt [message #470643 is a reply to message #469723] Tue, 03 July 2012 10:41 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3811
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).


Previous Topic: Set_Face_Location() and bots
Next Topic: Commands->Monitor_Sound
Goto Forum:
  


Current Time: Tue Dec 03 11:23:46 MST 2024

Total time taken to generate the page: 0.00817 seconds