/* by a59 */ #include #include void PrintEncrypted( char* szString, int CryptKey ) { int iLen = strlen( szString ); for( int i = 0; i < iLen; i++ ) { szString[ i ] ^= ( ( CryptKey * ( i + 1 ) - i ) % 32 ); printf( "\\x%02X", szString[ i ] ); } } int main( ) { char szCryptKey[ 6 ]; char szBuffer[ 50 ]; printf( "\t\t\tEncryption for ramey\n" ); printf( "Enter a crypt key: " ); scanf( "%s", szCryptKey ); while( true ) { printf( "Enter a string to encrypt: " ); scanf( "%s", szBuffer ); PrintEncrypted( szBuffer, atoi( szCryptKey ) ); printf( "\n" ); } return 0; }