|
You last visited: Today at 03:09
Advertisement
C++ Password Seed
Discussion on C++ Password Seed within the CO2 Private Server forum part of the Conquer Online 2 category.
02/13/2011, 19:54
|
#16
|
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.
|
|
|
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
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?
|
|
|
02/13/2011, 20:03
|
#18
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by unknownone
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;
}
|
|
|
02/13/2011, 20:06
|
#19
|
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.
|
|
|
02/13/2011, 20:12
|
#20
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by Basser
You realize there is no such thing as random in whatever programming language?
|
False.
|
|
|
02/14/2011, 03:47
|
#21
|
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
|
Quote:
Originally Posted by _tao4229_
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.
|
|
|
02/14/2011, 04:15
|
#22
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by bone-you
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.
|
|
|
02/14/2011, 04:32
|
#23
|
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.
|
|
|
02/14/2011, 04:48
|
#24
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by unknownone
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).
|
|
|
02/14/2011, 06:53
|
#25
|
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
|
Quote:
Originally Posted by _tao4229_
|
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.
|
.
|
|
|
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)
|
|
|
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.
|
|