File: rc4

package info (click to toggle)
hxtools 20231224-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,640 kB
  • sloc: ansic: 4,825; perl: 3,463; sh: 1,629; cpp: 353; makefile: 149
file content (10 lines) | stat: -rwxr-xr-x 385 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/perl -p
# SPDX-License-Identifier: MIT
#
#	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