C Program to Encrypt and Decrypt a Password (XOR Cipher)
This classic exercise asks you to encrypt and decrypt a password in C. The right teaching tool for it is the XOR cipher: XOR each character with a key byte, and XOR-ing a second time with the same key restores the original — one function does both directions. This page gives you a tested implementation …