Unit CryptUnit

BM-2cWv61m4UEEk5SqnQ86P6uNzTaJJRXVJ7A
Nov 9 18:45

Unit CryptUnit; Interface Type SSCState = Record DA,DB,DC,DD: Byte; { Four state indices } S0,S1:Array[0..255]Of Byte; { Encryption/decryption state arrays } End; Function Encrypted(Var State: SSCState; Const IB:Byte):Byte; { Encrypts one byte at time } Function Decrypted(Var State: SSCState; Const IB:Byte):Byte; { Decrypts one byte at time } Procedure BufEnc(Var State: SSCState; Var Data; Const Size:LongWord); { Encrypts data } Procedure BufDec(Var State: SSCState; Var Data; Const Size:LongWord); { Decrypts data } Procedure BufMut(Var State: SSCState; Const Data; Const Size:LongWord); { Mutates key with data WITHOUT encrypting it } Procedure DataInit(Var State: SSCState; Const Data; Const Size:LongWord; Const Rounds:LongWord; Const Mode:Boolean); Procedure PassInit(Var State: SSCState; Const Key : String; Const Rounds:LongWord; Const Mode:Boolean); Procedure DataKSA(Var State: SSCState; Const Key; Const KeySize:LongWord; Const Vec; Const VecSize:LongWord; Const Rounds:Longword); Procedure PassKSA(Var State: SSCState; Const Key:String; Const Vec; Const VecSize:LongWord; Const Rounds:LongWord); Procedure SetMAC(Var State: SSCState; Var MAC; Const MACSize:LongWord); { Calculates MAC of already processed data } Procedure SetKeys(Var State: SSCState); { Set keys in start position } Procedure KeyMut(Var State: SSCState); { key mutation } Procedure Burn(Var State: SSCState); { Cleans the whole internal state } Implementation Type ByteArray = Array[0..0] Of Byte; Function Suc(Const InByte:Byte):Byte; begin Suc := Byte(Inbyte+1); end; Function Pre(Const InByte:Byte):Byte; begin Pre := Byte(Inbyte-1); end; Procedure NextState(Var State: SSCState); { Uses current cipher state to produce next state } Procedure SWAB(Var A,B: Byte); { Swaps two bytes } Var C : Byte; Begin C := A; A := B; B := C; End; Begin With State Do Begin Inc(DD); DC := S0[S0[(S0[(S0[(S0[DD]+DC) And $FF]+DB) And $FF]+DA) And $FF]]; SWAB(S0[DA],S0[DD]); S1[S0[DA]]:=DA; S1[S0[DD]]:=DD; SWAB(S0[DB],S0[DC]); S1[S0[DB]]:=DB; S1[S0[DC]]:=DC; End; End; Function Encrypted(Var State: SSCState; Const IB:Byte):Byte; Begin With State Do Begin DA := S0[Suc(S0[Pre(S0[IB Xor S0[Pre(S0[Suc(S0[DC])])]])])]; DB := S0[Pre(S0[Suc(S0[DA Xor S0[Suc(S0[Pre(S0[DD])])]])])]; Encrypted := S0[Suc(S0[Pre(S0[Suc(S0[Pre(S0[DB])])])])]; End; NextState(State); End; Function Decrypted(Var State: SSCState; Const IB:Byte):Byte; Begin With State Do Begin DB := S1[Suc(S1[Pre(S1[Suc(S1[Pre(S1[IB])])])])]; DA := S1[Pre(S1[Suc(S1[DB])])] Xor S0[Suc(S0[Pre(S0[DD])])]; Decrypted := S1[Suc(S1[Pre(S1[DA])])] Xor S0[Pre(S0[Suc(S0[DC])])]; End; NextState(State); End; Procedure BufEnc(Var State: SSCState; Var Data; Const Size:LongWord); Var IC:LongWord; Buf:ByteArray Absolute Data; Begin For IC := 0 To Size-1 Do Buf[IC] := Encrypted(State,Buf[IC]); End; Procedure BufDec(Var State: SSCState; Var Data; Const Size:LongWord); Var IC:LongWord; Buf:ByteArray Absolute Data; Begin For IC := 0 To Size-1 Do Buf[IC] := Decrypted(State,Buf[IC]); End; Procedure BufMut(Var State: SSCState; Const Data; Const Size:LongWord); Var IC:LongWord; Buf:ByteArray Absolute Data; Begin For IC := 0 To Size-1 Do Encrypted(State, Buf[IC]); End; Procedure DataInit(Var State: SSCState; Const Data; Const Size:LongWord; Const Rounds:LongWord; Const Mode:Boolean); Var IC:LongWord; Begin If Mode Then SetKeys(State); For IC := 1 To Rounds Do Begin BufMut(State,Data,Size); KeyMut(State); End; End; Procedure PassInit(Var State: SSCState; Const Key : String; Const Rounds:LongWord; Const Mode:Boolean); Begin If Mode Then SetKeys(State); DataInit(State,Key[1],Length(Key),Rounds,Mode); End; Procedure DataKSA(Var State: SSCState; Const Key; Const KeySize:LongWord; Const Vec; Const VecSize:LongWord; Const Rounds:Longword); Var IC:LongWord; Begin SetKeys(State); BufMut(State,Key,KeySize); KeyMut(State); For IC := 1 To Rounds Do Begin BufMut(State,Vec,VecSize); KeyMut(State); BufMut(State,Key,KeySize); KeyMut(State); End; End; Procedure PassKSA(Var State: SSCState; Const Key:String; Const Vec; Const VecSize:LongWord; Const Rounds:LongWord); Begin DataKSA(State,Key[1], Length(Key), Vec, VecSize, Rounds); End; Procedure SetKeys(Var State: SSCState); Var IC:Byte; Begin With State Do Begin For IC := 0 To 255 Do S0[IC] := IC; For IC := 0 To 255 Do S1[IC] := IC; DC := 0; DD := 255; End; End; Procedure KeyMut(Var State: SSCState); Var IC : Byte; Begin With State Do Begin For IC := 0 To 255 Do Encrypted(State,Encrypted(State,Encrypted(State,Encrypted(State,S0[IC])))); End; End; Procedure SetMAC(Var State: SSCState; Var MAC; Const MACSize:LongWord); Var C:LongWord; Buf:ByteArray Absolute MAC; Begin For C := 0 To MACSize-1 Do Encrypted(State,C); KeyMut(State); For C := 0 To MACSize-1 Do Buf[C] := Encrypted(State,C); End; Procedure Burn(Var State: SSCState); Begin FillChar(State,SizeOf(State),0); End; End.

[chan] general
BM-2cW67GEKkHGonXKZLCzouLLxnLym3azS8r

Subject Last Count
https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/ Nov 21 17:19 1
[DELETED] Nov 21 14:13 3
Tor / Onion Nov 21 09:20 2
python upnp Nov 21 09:18 4
Tor idea Nov 21 08:57 2
Aktie 0.5.22 Nov 21 08:50 1
NASA Insider Exposes the Flat Earth! Nov 21 08:37 4
The Fall of Hacker Groups Nov 21 06:24 1
xiceg | kaxyx Nov 21 04:01 1
xufer | saxex Nov 21 03:44 1
xivov | saxex Nov 21 03:36 1
Alex Jones Wanker Nov 20 21:50 1
The Stallman Tax Nov 20 21:25 1
BREXIT IS BULLSHIT Nov 20 21:24 4
Neil Disgrace Tyson is Falling Faster Than The Globe Nov 20 21:24 1
The Russian Barbarity. Smolensk: The body of the Polish admiral was desecrated. Nov 20 20:55 3
Test Nov 20 20:09 8
Stop Fake News! Nov 20 15:04 1
Emily Nov 20 13:14 1
Tor replacement Nov 20 05:39 3
Landmark Worldwide Cult | rely maks ya think... Nov 20 04:47 1
Landmark Worldwide Cult Nov 20 04:38 1
Hollywood is turning black women into trannies Nov 19 21:57 5
Peter Šurda Nov 19 21:37 12
US Government resources for Zombie Preparedness Nov 19 19:46 1
bitconnect.co Nov 19 19:12 7
#elsagate cracked Nov 19 17:02 1
Remember Nov 19 16:31 5
SOON Nov 19 15:45 1
The NSA Nov 19 14:16 1
Decoding Twitter Account: https://twitter.com/GyKE69 Nov 19 13:58 5
https://www.youtube.com/watch?v=ufJjf9fYKxc Nov 19 12:57 1
vbcvbnbm,nv Nov 19 12:37 1
I AM HERE Nov 18 22:44 1
This is how they done it Nov 18 21:52 1
Leonard Nimoy Nov 18 11:08 5
North Korean defector had 'enormous amount' of parasitic worms in body Nov 18 09:29 1
Programming/hacking services provider Nov 18 08:23 2
Tranny Genocide Nov 18 03:17 1
teting codeword Nov 17 18:36 2
GENDER 101 COURSE SYLLABUS Nov 17 18:15 4
GENERAL FAILURE READING DRIVE A Nov 17 18:01 2
Flat Earth Society – Introductory Post Nov 17 17:59 4
Dear Guest: Nov 17 16:44 1
Rush Discography (1974 - 2012) mp3 320 kbps Nov 17 08:01 1
WTF is LBGTQ? Nov 17 04:01 12
Poland Pushes Back Against Putin's Special War Nov 16 20:07 2
HackThisSite.org Nov 16 13:14 3
teen girl white cotton panties Nov 16 12:56 1
Poland Must Be Alert Once Again to Protect Its Independence Nov 16 12:31 4
flat earth Nov 16 09:24 1
The Blue whale Game Nov 16 09:12 1
Tor Browser 7.0.10 is released Nov 16 08:21 1
BitMessage onionscan report Nov 15 23:36 18
eff63805060d0e8bada3fd9140bfd6c6 Nov 15 21:06 6
hello Nov 15 18:00 2
What should we do? Nov 15 17:30 1
Naked girl Nov 15 14:52 4
FourDigitPassword Nov 15 11:57 3
Leaks Nov 15 11:07 2
i2pd error Nov 15 05:53 3
«indisputable evidence» of U.S. Aid to ISIS Nov 15 05:53 1
All is A Will For Power Nothing More Nov 15 05:53 2
VPN, privacy & Firefox (+ other Gecko browsers)* rev. 0.3.13 Nov 13 10:38 1
VPN, privacy & Firefox (+ other Gecko browsers)* rev. 0.3.12 Nov 13 09:13 1
Your privacy - VPN & Firefox (+ other Gecko browsers)* rev. 0.3.11 Nov 12 19:29 1
weekend Nov 12 15:32 1
OTP PRACTICE ON WINDOWS Nov 12 14:52 7
Small Survival Ebooks Collection Nov 12 07:55 1
February 1997 Nov 12 07:02 3
03e3b4c5b30bbb7644f3f722900aca3a Nov 12 01:23 1
OPERATION RIGHT TO KNOW IS BACK! Nov 11 17:52 1
TOM DELONGE’S SERIOUS ATTEMPT AT UFO/ET DISCLOSURE Nov 11 17:47 1
Ddos/hack Nov 11 15:55 1
donate? Nov 11 04:53 4
Need help hacking a mobile game Nov 11 03:02 3
WARNING! OVER 300 TOR NODES COMPROMISED AFTER JOINT NSA-DGSE ACTION! Nov 10 21:27 8
Hello! :) Nov 10 21:27 2
Tor sucks. I2P sucks. Nov 10 19:21 1
WIKILEAKS - disinformation outlet Nov 10 19:12 1
https://www.itproportal.com/2014/05/14/microsoft-openly-offered-cloud-data-fbi-and-nsa/ Nov 10 15:42 11
I need help hacking this website Nov 10 06:14 1
Unit CryptUnit Nov 9 18:45 1
FATAL SECURITY ERROR Nov 9 18:36 1
Apple's Operating Systems Are Malware Nov 9 18:33 1
So you want to have "secure" software without having secure hardware first? Nov 9 18:29 3
https://www.whonix.org/wiki/Computer_Security_Education#Windows_Hosts Nov 9 17:35 1
Hacking programming services needed Nov 9 08:15 2
bitconnect coin (bcc) Nov 8 21:19 6
Dutch secret service tries to recruit Tor-admin Nov 8 21:18 2
facebook-upload-your-nudes-to-stop-revenge-porn Nov 8 18:50 2
Something is wrong on the internet Nov 8 13:52 4
RECOMMENDATION #0002 Nov 8 12:27 2
RECOMMENDATION #0001 Nov 8 12:05 1
ARCHWAY QUEUE BARGAIN Nov 8 07:58 2
Russian disinformation bullshit analysed in real time Nov 7 20:15 1
Friends of Dorothy Nov 7 14:20 3
Private chan or Public? Nov 7 14:14 5
[DELETED] Nov 7 12:06 1
lucky boy Nov 7 10:47 2