File: rc4

package info (click to toggle)
hxtools 20180301-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,600 kB
  • sloc: ansic: 5,926; perl: 3,905; sh: 1,638; cpp: 342; makefile: 191; asm: 173
file content (9 lines) | stat: -rwxr-xr-x 354 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl -p
#
#	rc4 in *two* lines of Perl (139 chars)
#	Adam Beck <adam [at] cypherspace org>
#	Jan Engelhardt <jengelh [at] medozas de>, 2003 - 2004
#	and the PerlGolf team which also crunched it a lot
#
INIT{@k=pop=~/../g;$=map@s[$w++,$]=@s[$+=$_+hex$k[$w%@k],$w],@s=0..255}
s#\C#$&^chr$s[255&map{1..$_}@s[$,$x]=@s[++$x,$+=$s[$x%=@s]]]#eg