To ensure that encryption is consistent you can use the library function srand() which uses a single integer parameter to initialise the random number generator. The random initialisation can be regarded as an encryption key. Devise a decryption program to recover the text that you encrypted earlier.