#include <stdio.h>

char seed = 0x7C;
void encrypt(char *plain, char *cipher) {
	for (; *plain; ++plain, ++cipher) {
		*cipher = *plain;
		*cipher ^= seed;	// This can be an arbitrary sequence of operations.
	}
	*cipher = '\0';
}
void decrypt(char *cipher, char *decrypted) {
	for (; *cipher; ++cipher, ++decrypted) {
		*decrypted = *cipher;
		*decrypted ^= seed;	// This needs to reverse encryption.
	}
	*decrypted = '\0';
}
int main() {
	char plain[] = "CS1234";
	char cipher[20], decrypted[20];

	encrypt(plain, cipher);
	printf("Plain text = %s\n", plain);
	printf("Encrypted text = %s\n", cipher);

	decrypt(cipher, decrypted);
	printf("Encrypted text = %s\n", cipher);
	printf("Decrypted text = %s\n", decrypted);

	return 0;
}
