codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <stdio.h> char str[] = "a\x11\x33\n\xf1m"; const char crypter[] = { 0x10, 0x67, 0x56, 0x78, 0x85, 0x14, 0x87, 0x11, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45 }; int main( void ) { size_t i; char *p = str; printf( "Password [encrypted] [ascii]:\t%s\n", str ); printf( "Password [decrypted] [hex]:\t" ); for( i = 0; i < sizeof( str ); i++ ) { *p ^= crypter[i]; printf( "%#2x ", (unsigned char)*(p++) ); } printf( "\n" ); printf( "Password [decrypted] [ascii]:\t%s\n", str ); return 0; }
Private
[
?
]
Run code
Submit