Can the output of rand() function be predicted? If yes, how?

Ankita Katdare

Ankita Katdare

@abrakadabra Oct 22, 2024
To begin with, we ought to know what Rand() function does. The function is used to generate a pseudo-random integral number in the range between 0 and RAND_MAX. So, basically it has been used for ages to generate random numbers in algorithms worldwide. Take rand() function in C or PHP, I have read that the output of rand() function is predictable as it is a PRNG.

But, is there really a way of predicting the output of rand()?
Is it possible through a few thousand guesses? Please share your answers in replies.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Rajni Jain

    Rajni Jain

    @rajni-E46Rlm Jan 5, 2014

    Cracking Rand() should be possible, however I would say that it would be as good as doing a hacking tutorial.

    Search 'cracking, breaking, or attacking' for RNG (Random Number Generators).
    Searching any of those terms along with RNG should turn up a lot of results. You can try out the following link: #-Link-Snipped-#