I am fairly new to the programming game, well, in C that is. Anyways, I wrote a small program that should take user input, a single word and run it through a basic encryption algorithm, supplied in the source. The word is translated in decimal form and inserted into the algorithm so that it changes everytime you type something in. Here is the source.
--------begenning of code-------------
#include <stdio.h>
main() {
int unenc, enc;
printf("Please enter a word that you would like encrypted --> \n");
scanf("%s", &unenc);
for ( enc = 2 + 533 + unenc * unenc - 456 * unenc - 65 + 34 )
printf("Your word, encrypted is %s\n", enc);
}
------------end of file---------------
Now, I know that my for statement is the issue. I need to know how to use my unenc interger variable in the equation. What is the problem???



LinkBack URL
About LinkBacks



Definately time to rethink. I agree XOR is a good place to start, it's easy to understand and simple to implement, and the best thing: write the encryption function, and you've automatically created the decryption one without even trying.