Thread: A few simple questions that some1 might b able to help me with

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154
    Well, if rand() does give the same random letters for the same speeds, how do u get completely random letters?


  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    You can not make completely random letters, you can always calculate the next number (although it might be hard). Computers can only produce pseudo-random (spelling?) numbers.

  3. #3
    Registered User
    Join Date
    Dec 2004
    Location
    UK
    Posts
    109
    As shakti said it is impossible for a program to generate completely random output.
    The only way to truly generate random numbers on a computer is to use specialized hardware which is not common by any means. (one of the lecturers at my uni has a quantum random number generator that can be installed as a pci card )

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Look up the srand() function. It seeds the inbuilt random number generator. With the same seed value, rand() will produce the same sequence every time, using srand() with the current date and time say, will generate a different pseudo-random sequence.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    The decryption process needs to be able to undo the encryption in order for the entire process to be meaningful. If you don't like the idea of non-random placement of message char in the file as suggested by siegfriedmcwild, then you will need to encode a mechanism as to how to find the embedded message char if they are randomly placed in the file. One approach might be to keep track of where in the encrypted file you can find the desired char. The encrypted file could then contain the number of char in the message, the location of the embedded char of the message, and the encrypted message itself (where the message char are "randomly" placed). Of course, you would want to encrypt the administrative data in a non-random fashion so you can decrypt it before using it to decrypt the randomly embedded message, but it adds another couple levels of subterfuge the intrepid intruder needs to overcome.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A couple questions
    By Flakster in forum C++ Programming
    Replies: 7
    Last Post: 08-09-2005, 01:22 PM
  3. Few simple questions...
    By Shane in forum C++ Programming
    Replies: 9
    Last Post: 08-06-2005, 02:40 AM
  4. A few simple batch questions
    By sean in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-02-2003, 01:35 PM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM