Методы и средства защиты информации



              

Механизм действия S-блоков - часть 5


 

outblock$=""

 

get$ #1,rest1,inblock$

Продолжение листинга 18.3

 if rest2 > 0 then

 

inblock$=inblock$+left$(anything$,(8-rest2))

 

end if

 

for b%=1 to len(inblock$) step 8

 

outblock$ = outblock$+desalg$(mid$(inblock$,b%,8))

 

next   

 

Put$ #2, outblock$

END IF

CLOSE

LOCATE 10, 19: PRINT "100 %  завершено"

PRINT : PRINT "Шифрование по алгоритму DES завершено."

PRINT

SYSTEM

' Данные и функции

InitialTrl:

DATA 58,50,42,34,26,18,10,02,60,52,44,36,28,20,12,04

DATA 62,54,46,38,30,22,14,06,64,56,48,40,32,24,16,08

DATA 57,49,41,33,25,17,09,01,59,51,43,35,27,19,11,03

DATA 61,53,45,37,29,21,13,05,63,55,47,39,31,23,15,07

FinalTrl:

DATA 40,08,48,16,56,24,64,32,39,07,47,15,55,23,63,31

DATA 38,06,46,14,54,22,62,30,37,05,45,13,53,21,61,29

DATA 36,04,44,12,52,20,60,28,35,03,43,11,51,19,59,27

DATA 34,02,42,10,50,18,58,26,33,01,41,09,49,17,57,25

swappyl:

DATA 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48

DATA 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64

DATA 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16

DATA 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32

KeyTr1l:

DATA 57,49,41,33,25,17,09,01,58,50,42,34,26,18,10,02

DATA 59,51,43,35,27,19,11,03,60,52,44,36

DATA 63,55,47,39,31,23,15,07,62,54,46,38,30,22,14,06

DATA 61,53,45,37,29,21,13,05,28,20,12,04

Продолжение листинга 18.3

KeyTr2l:

DATA 14,17,11,24,01,05,03,28,15,06,21,10,23,19,12,04

DATA 26,08,16,07,27,20,13,02,41,52,31,37,47,55,30,40

DATA 51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32

etrl:

DATA 32,01,02,03,04,05,04,05,06,07,08,09,08,09,10,11

DATA 12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21

DATA 22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,01

ptrl:

DATA 16,07,20,21,29,12,28,17,01,15,23,26,05,18,31,10

DATA 02,08,24,14,32,27,03,09,19,13,30,06,22,11,04,25

sboxesl:

DATA 14,04,13,01,02,15,11,08,03,10,06,12,05,09,00,07

DATA 00,15,07,04,14,02,13,01,10,06,12,11,09,05,03,08

DATA 04,01,14,08,13,06,02,11,15,12,09,07,03,10,05,00

DATA 15,12,08,02,04,09,01,07,05,11,03,14,10,00,06,13



Содержание  Назад  Вперед