Register for your free account! | Forgot your password?

You last visited: Today at 03:09

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C++ Password Seed

Discussion on C++ Password Seed within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old 02/13/2011, 19:54   #16
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Again, you can't just use any random numbers. You must use the specific ones produced by rand(), otherwise the client and the server are not going to have the same cryptography. The psuedo-random numbers are used such that the server and client will always produce the same result, and thus be able to decrypt/encrypt the password.

Ok, perhaps I misread. You're referring to what value you can put into the seed packet: In that case, anything. But you must then use that same value in your call to srand() to seed your RC5.
unknownone is offline  
Old 02/13/2011, 19:58   #17
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
Quote:
Originally Posted by Mr_PoP View Post
well this one works :

Code:
//random seed
void rPassSeed(char *seed)
{
	srand ( time(NULL) );
	char k[8];
	for (int i=0;i<8;i++)
	{
		k[i]=rand()%10;
	}
	sprintf(seed,"%d%d%d%d%d%d%d%d",k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7]);
}
You realize there is no such thing as random in whatever programming language?
Basser is offline  
Old 02/13/2011, 20:03   #18
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by unknownone View Post
Again, you can't just use any random numbers. You must use the specific ones produced by rand(), otherwise the client and the server are not going to have the same cryptography. The psuedo-random numbers are used such that the server and client will always produce the same result, and thus be able to decrypt/encrypt the password.

Ok, perhaps I misread. You're referring to what value you can put into the seed packet: In that case, anything. But you must then use that same value in your call to srand() to seed your RC5.
ah i see so this one good?

Code:
void r(char *w)
{
	char k[8];
	for (int i=0;i<8;i++)
	{
		k[i]=rand()%10;
	}
	sprintf(w,"%d%d%d%d%d%d%d%d",k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7]);
}

int main()
{
	char test[9];
	r(test);
	cout << test;
}
Mr_PoP is offline  
Old 02/13/2011, 20:06   #19
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
You sprintf is pointless. You never need to read the value as text, only send it as an ineteger. In the case, you only need 4 bytes, and you can simply make an int point to the array location for it. It really doesn't matter what you send in that packet. Since you appear to be just starting out anyway, it might be better for you to just put a constant value as the seed for now. You can always update it later.
unknownone is offline  
Thanks
1 User
Old 02/13/2011, 20:12   #20
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Quote:
Originally Posted by Basser View Post
You realize there is no such thing as random in whatever programming language?
False.
_tao4229_ is offline  
Thanks
1 User
Old 02/14/2011, 03:47   #21
 
bone-you's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
Quote:
Originally Posted by _tao4229_ View Post
False.
False. There are no random numbers in computing. The numbers are all coming from something. When I ask you to give me a random number from your head, you will just think of a random number. The source of that number is nothing. If you ask a computer to generate a random number, it cannot give you a number based on nothing. It must either pull a piece of memory or do some calculations. Both are subject to the flaw that if that section of memory is the same for each consecutive call, it will give the same random number. Also, if the seed given for the calculations is the same, it will give the same random number. There is no truly random to computers. If I say 4,5,6,7,2,5,1,5,7,5,4,1,8,1,1,6,1, that was completely random. There was no basis to them. I just looked away and pressed random keys. Because air friction, movement of my body, etc, is never the same for each press, it truly is random as the same exact conditions would never happen again.

tl;dr, computers can't generate random numbers.
bone-you is offline  
Old 02/14/2011, 04:15   #22
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Quote:
Originally Posted by bone-you View Post
False. There are no random numbers in computing. The numbers are all coming from something. When I ask you to give me a random number from your head, you will just think of a random number. The source of that number is nothing. If you ask a computer to generate a random number, it cannot give you a number based on nothing. It must either pull a piece of memory or do some calculations. Both are subject to the flaw that if that section of memory is the same for each consecutive call, it will give the same random number. Also, if the seed given for the calculations is the same, it will give the same random number. There is no truly random to computers. If I say 4,5,6,7,2,5,1,5,7,5,4,1,8,1,1,6,1, that was completely random. There was no basis to them. I just looked away and pressed random keys. Because air friction, movement of my body, etc, is never the same for each press, it truly is random as the same exact conditions would never happen again.

tl;dr, computers can't generate random numbers.
Measurement in quantum mechanics - Wikipedia, the free encyclopedia

tl;dr, generates randomness just like the universe and us.
you're getting trolled.
_tao4229_ is offline  
Old 02/14/2011, 04:32   #23
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Some would argue that nothing in the universe is random. Humans certainly aren't - you can program them as easily as any computer if you control what information goes in.
unknownone is offline  
Old 02/14/2011, 04:48   #24
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Quote:
Originally Posted by unknownone View Post
Some would argue that nothing in the universe is random. Humans certainly aren't - you can program them as easily as any computer if you control what information goes in.
Some would.
However the randomness of a quantum state is as close to random as one can observe (except that you can't).
_tao4229_ is offline  
Old 02/14/2011, 06:53   #25
 
bone-you's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
Quote:
Originally Posted by _tao4229_ View Post
Measurement in quantum mechanics - Wikipedia, the free encyclopedia

tl;dr, generates randomness just like the universe and us.
you're getting trolled.
Quote:
The measurement process is often said to be random and indeterministic. (However, there is considerable dispute over this issue; in some interpretations of quantum mechanics, the result merely appears random and indeterministic, in other interpretations the indeterminism is core and irreducible.) This because an important aspect of measurement is wavefunction collapse, the nature of which varies according to the interpretation adopted.
.
bone-you is offline  
Old 02/15/2011, 11:20   #26
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Found this interesting: (I don't take credits)
Syst3m_W1z4rd is offline  
Reply


Similar Threads Similar Threads
Farmerama seed bot
03/06/2012 - Browsergames - 14 Replies
anyone know that game ? farmerama.com its cool game but I need some help ... where I can get seed bot :P ? help me
Seed's ID's
11/12/2011 - Lineage 2 - 1 Replies
Mans need a Seed's ID for Manor System Regards Ty :bandit: :bandit: :bandit: :bandit: :bandit: :bandit:
Seed on mobs
10/05/2009 - Lineage 2 - 10 Replies
I`m using ig walker 2.05 Basic->combact heal->I did activate the Auto Use Seed but i dont`t use them, lf help.
SEED
01/26/2006 - General Gaming Discussion - 1 Replies
Von Dänen entwickeltes MMORPG in Cellshading Style (XVIII oder so...oder wie Xmen Legends 2) http://www.seedthegame.com/news.php



All times are GMT +1. The time now is 03:10.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.