#! perl -slw use strict; use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'END_C', NAME => 'junk1_IC', CLEAN_AFTER_BUILD => 0; void decrypt( char *e, char *key ) { while( *e ) *e++ = *e ^ *key++; return; } SV *testit( SV *e, SV *key ) { SV *r = newSVsv( e ); decrypt( SvPVX( r ), SvPVX( key ) ); return r; } END_C use List::Util qw[ shuffle ]; use Data::Dump qw [ pp ]; use constant KEY => join'', shuffle map chr, 0 .. 255; my $source = 'the quick brown fox jumps over the lazy dog'; my $encrypted = $source ^ substr( KEY, 0, length( $source ) ); print "Encrypted:[$encrypted]"; my $decrypted = testit( $encrypted, KEY ); print "Decrypted:[$decrypted]"; __END__ C:\test>1172052.pl Encrypted:[Ù?Â→┬ßÁÀFBQÏnå 8üõø♣ÆÄãk­i↨üÿtë½§↨♠,♫õ"æ↓oó] Decrypted:[the quick brown fox jumps over the lazy dog]