Using sha1prng in both android and windows giving different sequences

I have used sha1prng in both my android program and java program as the pseudo-ramdom number generator algorithm. I sowed both of them at the same value.

But the sequence generated in android is different from the one generated in java. Why is this happening and what is the solution to this problem?


source to share

1 answer

I think this is because the SHA1PRNG implementation is different on Windows and Android. Android uses Crypto as a provider, while Windows SDK uses Sun's JCE provider as the SHA1PRNG implementation. The output sequence with the same seed differs even in different JDK versions, as discussed here: . For different SHA1PRNG implementations, you can check this link: .



All Articles