Random Key Generation Algorithm In Java
Key generators are constructed using one of the getInstance class methods of this class. KeyGenerator objects are reusable, i.e., after a key has been generated, the same KeyGenerator object can be re-used to generate further keys. There are two ways to generate a key: in an algorithm-independent manner. Java Cryptography - KeyGenerator - Java provides KeyGenerator class this class is used to generate secret keys and objects of this class are reusable. Dec 14, 2011 Random Number Generation in Java:-Java provides mainly two sets of API/classes to generate Random numbers: Random and SecureRandom. Random API: This is used to generate a stream of pseudorandom numbers. It uses a 48-bit seed (the initial data) which is then modified using a linear congruential formula. On this github page there is utility class written in Java which performs encryption/decryption using symmetric algorithm, below could be one of encryption flows using symmetric algorithm: generate secret key using the selected algorithm (DES, 3DES, AES etc).
Well I need a pseudo Random Number Generation algorithm which makes the numbers repeat after a certain userdefined period.
Please some one help me with the same asap since I need it very badly and soon.
Tanx for all the help.
Regds
Gautham Kasinath
P.S. Sheriffs and Bartenders please forgive my posting the message here since I didnot now where to post the same.
'In the country of the blind, the one eyed man is the King'
Gautham Kasinath CV at : http://www.geocities.com/gkasinath
------------------
- Ryan Burgdorfer
- Java Acolyte in
- Columbus, OH USA
/cisco-asa-ssh-crypto-key-generate.html. <UL TYPE=SQUARE><I><LI>Ryan Burgdorfer<BR><LI>Java Acolyte</I></UL>
Well I guess that would will lower the performance of what i m coding.
What I was looking for is a ready made algorithm that generates pseudo random numbers. the numbers are bound to repeat sequence over a period of time.
Regds
Gautham Kasinath
'In the country of the blind, the one eyed man is the King'
Gautham Kasinath CV at : http://www.geocities.com/gkasinath
http://tilde-hoschek.home.cern.ch/~hoschek/colt/index.htm
Though, the java random() function may be the cleaner solution.
Sean
Free Java Algorithms
--Mark
hershey@vaultus.com
Random Key Generation Algorithm In Java 10
posted 19 years ago<code><pre>
import java.util.Random;
class CyclicRandom {
private Random random;
private long seed;
private int period;
private int count;
public CyclicRandom(long seed, int period) {
random = new Random(seed);
this.seed = seed;
this.period = period;
}
public long nextLong() {
next();
return random.nextLong();
}
public double nextDouble() {
next();
return random.nextDouble();
}
private void next() {
count++;
if (count > period) {
random.setSeed(seed);
count = 0;
}
}
}
</code></pre>
[This message has been edited by Jim Yingst (edited March 29, 2001).]