How to Decode Encrypted Viaccess - part 2

Kui soovid välja käia mingi tarkusetera siis postita siia. Vastusteks olgu ainult teema edasiarendused.
Kasutaja avatar
admin
Admin
Postitusi: 594
Liitunud: 15:06, 11 Jaan 2003
Asukoht: Saaremaa
    unknown unknown
On tänanud: 6 korda
On tänatud: 22 korda
Kontakt:

How to Decode Encrypted Viaccess - part 2

PostitusPostitas admin » 20:41, 14 Jaan 2003

Substitution or S-Boxes
*************************

We now XOR one block of R1 with one block of key we prepared earlier,
Each of these blocks is used to locate an entry in one of the eight
tables below, called Substitution or S-Boxes.



Substitution Box 1
E0 00 40 F0 D0 70 10 40
20 E0 F0 20 B0 D0 80 10
30 A0 A0 60 60 C0 C0 B0
50 90 90 50 00 30 70 80
40 F0 10 C0 E0 80 80 20
D0 40 60 90 20 10 B0 70
F0 50 C0 B0 90 30 70 E0
30 A0 A0 00 50 60 00 D0


Substitution Box 2
0F 03 01 0D 08 04 0E 07
06 0F 0B 02 03 08 04 0E
09 0C 07 00 02 01 0D 0A
0C 06 00 09 05 0B 0A 05
00 0D 0E 08 07 0A 0B 01
0A 03 04 0F 0D 04 01 02
05 0B 08 06 0C 07 06 0C
09 00 03 05 02 0E 0F 09


Substitution Box 3
A0 D0 00 70 90 00 E0 90
60 30 30 40 F0 60 50 A0
10 20 D0 80 C0 50 70 E0
B0 C0 40 B0 20 F0 80 10
D0 10 60 A0 40 D0 90 00
80 60 F0 90 30 80 00 70
B0 40 10 F0 20 E0 C0 30
50 B0 A0 50 E0 20 70 C0

Substitution Box 4
07 0D 0D 08 0E 0B 03 05
00 06 06 0F 09 00 0A 03
01 04 02 07 08 02 05 0C
0B 01 0C 0A 04 0E 0F 09
0A 03 06 0F 09 00 00 06
0C 0A 0B 01 07 0D 0D 08
0F 09 01 04 03 05 0E 0B
05 0C 02 07 08 02 04 0E


Substitution Box 5
20 E0 C0 B0 40 20 10 C0
70 40 A0 70 B0 D0 60 10
80 50 50 00 30 F0 F0 A0
D0 30 00 90 E0 80 90 60
40 B0 20 80 10 C0 B0 70
A0 10 D0 E0 70 20 80 D0
F0 60 90 F0 C0 00 50 90
60 A0 30 40 00 50 E0 30


Substitution Box 6
0C 0A 01 0F 0A 04 0F 02
09 07 02 0C 06 09 08 05
00 06 0D 01 03 0D 04 0E
0E 00 07 0B 05 03 0B 08
09 04 0E 03 0F 02 05 0C
02 09 08 05 0C 0F 03 0A
07 0B 00 0E 04 01 0A 07
01 06 0D 00 0B 08 06 0D


Substitution Box 7
40 D0 B0 00 20 B0 E0 70
F0 40 00 90 80 10 D0 A0
30 E0 C0 30 90 50 70 C0
50 20 A0 F0 60 80 10 60
10 60 40 B0 B0 D0 D0 80
C0 10 30 40 70 A0 E0 70
A0 90 F0 50 60 00 80 F0
00 E0 50 20 90 30 20 C0


Substitution Box 8
0D 01 02 0F 08 0D 04 08
06 0A 0F 03 0B 07 01 04
0A 0C 09 05 03 06 0E 0B
05 00 00 0E 0C 09 07 02
07 02 0B 01 04 0E 01 07
09 04 0C 0A 0E 08 02 0D
00 0F 06 0C 0A 09 0D 00
0F 03 03 05 05 06 08 0B



we now form a new R called R2 from
the 1st block uses Box-1 + the 2nd Box-2 to form frist byte of R2
the 3rd block uses Box-3 + the 4th Box-4 to form second byte of R2
the 5th block uses Box-5 + the 6th Box-6 to form third byte of R2
the 7th block uses Box-7 + the 8th Box-8 to form forth byte of R2

Example:
---------
1st block of key = 2D
1st block of R1 = 22
2D xor 22 = 0F (decimal 15)
this is the location 15 in the frist box (which is = 10)

2nd block of key = 0F
2nd block of R1 = 2E
0F xor 2E = 21 (decimal 33 )
this is the location 33 in the second box (which is = 0D)

so frist byte of R2 is 10 + 0D =1D
----------

Permutation or P Table
************************
The last operation is to create a (third and final) R called R3 from
R2 by using the following Permutation or P Table:


16 7 20 21
29 12 28 17
1 15 23 26
5 18 31 10
2 8 24 14
32 27 3 9
19 13 30 6
22 11 4 25

This means that the 1st bit of R3 is the 16th of R2, the 2nd is the 7th and
so on, with the 32nd being the 25th bit of R2.



PROCESS ITERATION
******************
The net result of the previous sections was to split the encrypted word into
two halves, ignore the left-hand one L and eventually create a new
right-hand one R3.

Now we XOR L and R3 together, and we've finished a decryption round.

For the next round, we treat old R (before applay viaccess mode)
as the left-hand half of a new data word and the result of
the XOR operation as the right-hand half and
***********************************


We do this 16 times and we end up with a last left-right pair of 32 bits
each. Put these together and we have a decrypted 8 byte word.

Continue the whole decryption process for the second encrypted word obtained
from the 88 instruction dialogue and then both can be sent to the Receiver
via the C0 instruction dialogue and the TV picture is unscrambled!


-----------------------------------
complete decode log for 16 rounds
DECODING START
----------------------------------------

DES_Round=0
**********
(L)=B0 BD D8 4D (R)=71 77 CF DD
Shift Key=4E 76 5F 86 48 0D D0
PC2= 2D 0F 28 15 1C 25 12 28 //6 bits only in evry byte
R(0)=17 //applay viaccess mode
R1=22 2E 2E 2F 39 1F 3B 3A //6 bits only in evry byte
Key Xor R1=0F 21 06 3A 25 3A 29 12 //6 bits only in evry byte
R2=1D E2 CD 19
R3= 1B 4D 69 1E
L xor R3=AB F0 B1 53
new R=AB F0 B1 53


DES_Round=1
**********
(L)=71 77 CF DD (R)=AB F0 B1 53
Shift Key=9C EC BF 0C 90 1B A0
PC2= 3F 07 34 06 02 2F 30 06
R(0)=B8
R1=37 31 1E 21 16 22 2A 27
Key Xor R1=08 36 2A 27 14 0D 1A 21
R2=26 F6 39 A2
R3= 74 43 37 95
L xor R3=05 34 F8 48
new R=05 34 F8 48


DES_Round=2
**********
(L)=AB F0 B1 53 (R)=05 34 F8 48
Shift Key=73 B2 FC 22 40 6E 83
PC2= 18 2A 1D 1D 0B 04 16 30
R(0)=7A
R1=0F 34 06 29 1F 30 09 10
Key Xor R1=17 1E 1B 34 14 34 1F 20
R2=BA B3 34 67
R3= E4 DA 0F AE
L xor R3=4F 2A BE FD
new R=4F 2A BE FD


DES_Round=3
**********
(L)=05 34 F8 48 (R)=4F 2A BE FD
Shift Key=CE CB F0 99 01 BA 0C
PC2= 13 1D 10 37 22 14 21 03
R(0)=61
R1=2C 02 25 15 17 3D 1F 3A
Key Xor R1=3F 1F 35 22 35 29 3E 39
R2=D5 E6 09 23
R3= 10 C3 FD 16
L xor R3=15 F7 05 5E
new R=15 F7 05 5E


end of part two

Mine

Kes on foorumil

Kasutajad foorumit lugemas: Registreeritud kasutajaid pole ja 18 külalist