SlideShare a Scribd company logo
1 of 21
Download to read offline
Cryptography
Homeworks
Ferro Demetrio 207872
Minetto Alex 211419
Cryptography Homeworks
Contents
Homework 1 1
Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Cryptanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Further Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Homework 2 10
Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Elliptic Curves Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
LFSR Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Ferro Demetrio, Minetto Alex
Cryptography Homeworks
Homework 1 - Caesar code with permuted alphabet
Assignment
Decrypt the following message which has been encrypted using Caeser cipher with the al-
phabet letters in a permuted order that is part of the secret key.
9, 13, 3, 4, 21, 30, 15, 28, 0, 24, 4, 0, 3, 14, 3, 21,
4, 28, 12, 12, 30, 19, 3, 27, 4, 28, 4, 9, 21, 30, 17, 29,
12, 3, 4, 24, 5, 30, 9, 4, 9, 30, 4, 21, 3, 15, 28, 1,
0, 4, 24, 1, 15, 5, 12, 16, 4, 9, 30, 4, 28, 14, 30, ...
The frequencies of the 26 alphabet letters plus 5 special characters (i.e. blank and punctua-
tion marks) are orderly encoded as two digit numbers from 0 to 25, and: ”blank” is encoded
as 26, ”-” is encoded as 27, ”,” is encoded as 28, ”.” is encoded as 29, ”;” is encoded as 30, are:
"a", 5.856417935 "b", 0.915065302 "c", 1.746994285
"d", 3.161113468 "e", 8.734714250 "f", 1.622161218
"g", 1.688711422 "h", 4.999584061 "i", 5.814824058
"j", 0.116462856 "k", 0.457532651 "l", 2.753514683
"m", 1.256135097 "n", 5.606854671 "o", 6.239081607
"p", 0.873471425 "q", 0.066550200 "r", 3.660261209
"s", 5.257466101 "t", 7.528491806 "u", 2.104650195
"v", 0.856833874 "w", 1.514017137 "x", 0.124781632
"y", 3.105981199 "z", 0.058231428 " ", 15.97728974
"-", 0.066550200 ",", 1.081440812 ".", 6.738208136
"?", 0.016637550
Ferro Demetrio, Minetto Alex Page 1 of 19
Cryptography Homeworks
Problem Statement
Caeser cipher encrypting systems are usually based on a circular shift of the reference al-
phabet A, generating a new set Aσ, containing all the elements of A shifted by σ positions.
In our case, we have a further permutation of the resulting shifted alphabet, call it Aσπ0 .
Considering the set:
A := {an}30
n=0 ≡ { a b c d e f g h i j k l m n o p q r s t u v w x y z − , . ? }
By applying Caeser ciphering Σ(·, σ) with σ = 3 we get to Aσ = Σ(A, σ),
for every an, we define am = an+σ ∀m, n = 0, · · · , 30 :
Aσ := {am}30
m=0 ≡ { d e f g h i j k l m n o p q r s t u v w x y z − , . ? a b c }
By applying a permutation Π0(·) to the originary alphabeth we get to a new set Aπ0 = Π0(A).
By applying the same permutation Π(·) to the shifetd alphabeth Aσ we get to a new set
Aσπ0 = Π0(Aσ) = Π0(Σ(A, σ)).
We wanted to exploit the fact that applying a permutation to a shifted version of the alphabet
is equivalent to apply a different permutation to the original alphabeth.
Calling Π the new permutation, Π = Π0(Σ(·, σ)), we get: Aσπ0 = Π0(Σ(A, σ)) = Π(A) = Aπ.
This can be shown even by using characters given by the assignment.
a b c d e f g h i j k l m n o p q r s t u · · · ?
by applying a 3-characters shift, we get the following:
d e f g h i j k l m n o p q r s t u v w x · · · c
then we apply a random permutation:
v f c p k . g - q n h e , u y ? z s o a · · · l
the effect of the combination of the two operations may be interpreted as a single new per-
mutation.
Given an encrypted text obtained by doing these operations, one can not determine either
the permuted version of the alphabet comes by permuting the reference alphabet or by per-
muting a shifted version of it.
One can ignore the knowledge of the previous permutation rule Π0(·) acting on the Caesar
ciphered text, hence the knowledge of the Caesar Key σ, since they may be considered as a
single permutation Π(·).
Ferro Demetrio, Minetto Alex Page 2 of 19
Cryptography Homeworks
Cryptanalysis
The purpose of our cryptanalysis is to identify the permuted alphabet A˜π in order to recon-
struct the message by inverting the permutation: Π−1
(Aπ) = A.
In order to do this, we start from the assumption that the plaintext M is written in English.
Considering T an exhaustive text containing all possible English words: T := {ti ∈ A}
|T |
i=1,
The statistics of the occurrences of each character in the text may be defined as:
P(T ) =
1
|T |
|T |
i=1
δ(ti = an), ∀n = 0, · · · , 30.
That essentially is the probability mass function of the English alphabet.
Since the text was encrypted by substitution cipher, we suppose that the distribution of the
occurrences of the letters does not change even if they are substituted.
So, given our Encrypted message E, we computed its probability mass function P(E).
P(E) =
1
|E|
|E|
i=1
δ(ei = an), ∀n = 0, · · · , 30.
In order to find the correspondence between the occurrences of English letters and the letters
of our message, we need to sort the probability mass functions (pmf), as shown in Figure 1.
By doing this, we get to a new disposition of the alphabet in both cases: AT and AE, where
the elements are sorted by their pmf.
From the Occurrences Analysis we can extract an Estimation of the permutation ˆΠ, that
can be used to determine ˆΠ−1
(E) = ˆM, with the assumption that ˆΠ Π.
Since the two mass functions P(T ), P(E) may not be so reliable, due to the fact that for
some characters the values assumed by the probability mass function are very close, the
estimation of the permutation rule is altered.
In order to reconstruct the plaintext we need to read the message applying the inverse
permutation rule and try to adjust it to improve the estimation of the permutation rule.
Ferro Demetrio, Minetto Alex Page 3 of 19
Cryptography Homeworks
Implementation
Alphabeth0(1,:)=[1:1:31];
2 Alphabeth0(2,:)=[’a’, ’b’, ’c’, ’d’, ’e’, ’f’,’g’, ’h’, ’i’,’j’, ’k’, ’l’,’m’, ’n’, ’o’,...
’p’, ’q’, ’r’,’s’, ’t’, ’u’,’v’, ’w’, ’x’,’y’, ’z’, ’_’,’-’, ’,’, ’.’,’?’];
4 Alphabeth0(3,:)=[5.856417935 0.915065302 1.7469942850 3.1611134681 8.734714250 ...
1.622161218 1.688711422 4.999584061 5.814824058 0.116462856 ...
6 0.457532651 2.753514683 1.256135097 5.606854671 6.239081607 ...
0.873471425 0.06655020 3.660261209 5.257466101 7.528491806 ...
8 2.104650195 0.856833874 1.514017137 0.124781632 3.105981199 ...
0.058231428 15.97728974 0.06655020 1.081440812 6.738208136 0.016637550]/100;
10
12 %% READ FROM ENCRYPTED NUMERICAL FILE
14 %EncText(1,:)=load(’encrypted_text.txt’)+1;
%EncText(1,:)=load(’EncryptedText.txt’)+1;
16
%EncText(1,:)=load(’encrypted_text.txt’)+1;
18 EncTextTemp=load(’encrypted_text.txt’)+1;
%EncTextTemp=load(’EncMiltonParadiseLost.txt’)+1;
20 EncText(1,:)=EncTextTemp;
EncText(2,:)=Alphabeth0(2,EncText(1,:));
22
fprintf(’Encrypted Text:n’);
24 fprintf(’%c’,EncText(2,:))
fprintf(’n__________________________________________n’);
26
% BUILDING PERMUTED ALPHABETH - STILL HAS TO BE PERMUTED
28 AlphabethP(1,:)=Alphabeth0(1,:);
AlphabethP(2,:)=Alphabeth0(2,:);
30 AlphabethP(3,:)=histc( EncText(1,:), unique(Alphabeth0(1,:)) )./length(EncText(1,:));
% conta le occorrenze delle lettere codificate in ordine alfabetico (non permutato)
32
% SORTING THE PMF IN ORDER TO GUESS THE MAPPING
34 [pmfp, indp]=sort(AlphabethP(3,:));
[pmfa, inda]=sort(Alphabeth0(3,:));
36
fprintf(’English Alphabeth Sorted By Pmf:n’);
38 AlphabethSortedByPmf=Alphabeth0(2,inda);
fprintf(’%c’,AlphabethSortedByPmf);
40 fprintf(’n__________________________________________n’);
42 fprintf(’Encrypted Text Alphabeth Sorted By Pmf:n’);
EncTextSortedByPmf=Alphabeth0(2,indp);
44 fprintf(’%c’,EncTextSortedByPmf);
fprintf(’n__________________________________________n’);
46
% PERMUTED ALPHABETH CONSTRUCTION - PERMUTATION IN PROGRESS
48
AlphabethP(2,:)=InterleaveText(Alphabeth0(2,:),Alphabeth0(2,indp),Alphabeth0(2,inda));
50 % approccio statistico : MAPPING PROBABILISTICI
Ferro Demetrio, Minetto Alex Page 4 of 19
Cryptography Homeworks
% e - _
52 % d - e
54 % PERMUTED ALPHABETH - PERMUTATION BY MANUAL RECONSTRUCTION
AlphabethPTrue(2,:)=double(’nige_pk.ct,xlhvmyujwqr?fsz-dabo’);
56 %AlphabethPTrue(2,:)=double(’bcdefghijklmnopqrstuvwxyz_-,.?a’);
58 % approccio manuale : SCAMBI FATTI A MANO
% simboli p i certi - simboli per cui si scambia
60 % h - i
% o - .
62 % n - c
% r - c
64 % i - s
% g - w
66 % c - l
% w - m
68 % n - .
% v - b
70 % w - y
% y - .
72 % p - .
% j - -
74 % x - q
76 AlphabethP(1,:)=TextToIndices(AlphabethP(2,:),Alphabeth0(1,:),Alphabeth0(2,:));
AlphabethP(3,:)=AlphabethP(3,AlphabethP(1,:));
78
% COMPUTING THE NUMBER OF PERMUTATION GUESSES
80 Guesses=AlphabethP(2,AlphabethP(2,:)==double(’nige_pk.ct,xlhvmyujwqr?fsz-dabo’));
%Guesses=AlphabethP(2,AlphabethP(2,:)==double(’bcdefghijklmnopqrstuvwxyz_-,.?a’));
82 if(˜isempty(Guesses))
GuessesSorted=Alphabeth0(2,sort(TextToIndices(Guesses,AlphabethP(1,:),AlphabethP(2,:))));
84 end
Guesses0=Alphabeth0(2,AlphabethP(2,:)==double(’nige_pk.ct,xlhvmyujwqr?fsz-dabo’));
86 %Guesses0=Alphabeth0(2,AlphabethP(2,:)==double(’bcdefghijklmnopqrstuvwxyz_-,.?a’));
88 fprintf(’Alphabeth Mapping:n’);
fprintf(’%c’,Alphabeth0(2,:));
90 fprintf(’n’);
fprintf(’%c’,AlphabethP(2,:));
92 fprintf(’n’);
fprintf(’%c’,AlphabethPTrue(2,:));
94 fprintf(’n__________________________________________n’);
fprintf(’Guesses: %dn’,length(Guesses));
96 if(˜isempty(Guesses))fprintf(’%c’,GuessesSorted);end;
fprintf(’n__________________________________________n’);
98
% DECRYPTION BY USING THE PMF OBTAINED FROM STATISTICS
100 DecText(2,:)=InterleaveText(EncText(2,:),Alphabeth0(2,:),AlphabethP(2,:));
DecText(1,:)=TextToIndices(DecText(2,:),Alphabeth0(1,:),Alphabeth0(2,:));
102
Ferro Demetrio, Minetto Alex Page 5 of 19
Cryptography Homeworks
% COMPUTING THE ALPHABETH DISTRIBUTION OF THE SUPPOSED PLAINTEXT
104 % IT IS DIFFERENT FROM THE ENGLISH ONE
106 AlphabethD(2,:)=InterleaveText(Alphabeth0(2,:),Alphabeth0(2,:),AlphabethP(2,:));
AlphabethD(1,:)=TextToIndices(Alphabeth0(2,:),Alphabeth0(1,:),Alphabeth0(2,:));
108 AlphabethD(3,:)=histc(DecText(1,:),unique(AlphabethD(1,:)))./length(DecText(1,:));
char(AlphabethD(2,:))
110
[pmfd, indd]=sort(AlphabethD(3,:));
112
fprintf(’Decrypted message Alphabeth Sorted By Pmf:n’);
114 DecSortedByPmf=AlphabethD(2,indd);
fprintf(’%c’,DecSortedByPmf);
116 fprintf(’n__________________________________________n’);
118 fprintf(’%c’,EncText(2,:));
fprintf(’n’);
120 fprintf(’%c’,DecText(2,:));
fprintf(’n’);
122 fprintf(’n__________________________________________n’);
124 % DECRYPTING BY USING MANUAL RECOSTRUCTED PERMUTATION
DecTextTrue(2,:)=InterleaveText(EncText(2,:),Alphabeth0(2,:),AlphabethPTrue(2,:));
126 DecTextTrue(1,:)=TextToIndices(DecText(2,:),Alphabeth0(1,:),Alphabeth0(2,:));
128 % COMPUTING THE ALPHABETH DISTRIBUTION OF THE TRUE PLAINTEXT
% IT IS DIFFERENT FROM THE ENGLISH ONE BUT EQUAL TO THE SUPPOSED ONE
130 AlphabethDTrue(1,:)=Alphabeth0(1,:);
AlphabethDTrue(2,:)=Alphabeth0(2,:);
Listing 1: Matlab Implementation
Ferro Demetrio, Minetto Alex Page 6 of 19
Cryptography Homeworks
Results
? w z z q l
- s j _ x u k g v .
p h b o , k
m
f
w
c f x
g p c q u r l i y t
d -
r m h y s b n v i n a ,
o a . ? t j
e d
_ e
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
Encrypted Message Occurences
English Language Occurences
Figure 1: Probability Mass Functions of English Language and Encrypted Text.
The previously shown cryptanalysis formulation was implemented in Matlab ,
the output is the following:
Encrypted Text:
_________________________________________________________________
jndev?p,ayeadodve,mm?td-e,ejv?r.mdeyf?jej?evdp,baeybpfmqej?e,o?b-
ec?bacej?et,ve?odvebjke.di,rydejndqegadtejn,jet,vye-?aujesryjec?e
,t,qkejndqe,vde?amqef?yjf?ad-ej?ey?pd?adedmyduye,-o,aj,cdhejndvdx
?vdkejndqep,-det,vetbjnefnbmbfe,a-e,ajb?inryebaecvddidkebae?v-dve
a?jej?en,odej?exbcnjejndpebaebj,mqhhhejndqeadodvetdaje.qejn,jey,q
bacetnbineq?rei?ayj,ajmqend,vexv?pejndetbyd,ivdye?xe?rve-,qkejn,j
ejbpdend,mye,mmejnbacyhejndqejvryjd-ev,jndvejndbve?taein,v,ijdve,
a-efvr-daide_ega?tbacefdvxdijmqetdmmejn,jejbpdei?aj,bayejndeydd-y
e?xe,mmejnbacykec??-e,yetdmme,ye.,-hebje?rcnjej?e.devdpdp.dvd-ejn
,jejndvdebyea?jnbacep?vde-bxxbirmjej?ej,gdebaen,a-kep?vdefdvbm?ry
ej?ei?a-rijke?vep?vderaidvj,baebaebjyeyriidyykejn,aej?ej,gdejndem
d,-ebaejndebajv?-rijb?ae?xe,eadte?v-dve?xejnbacyhe.di,rydejndebaa
Ferro Demetrio, Minetto Alex Page 7 of 19
Cryptography Homeworks
?o,j?ven,yex?vedadpbdye,mmejn?ydetn?en,ode-?adetdmmera-dvejnde?m-
ei?a-bjb?ayke,a-emrgdt,vpe-dxda-dvyebaejn?ydetn?ep,qe-?etdmmera-d
vejndeadthejnbyei??madyye,vbydyef,vjmqexv?pexd,ve?xejnde?ff?adajy
ketn?en,odejndem,tye?aejndbveyb-dke,a-ef,vjmqexv?pejndebaivd-rmbj
qe?xepdaetn?e-?ea?jevd,-bmqe.dmbdodebaeadtejnbacyerajbmejndqen,od
en,-e,em?acedlfdvbdaide?xejndph
_________________________________________________________________
Alphabeth Sorted By Pmf:
?zq-jxkvpb,mwfgculydrhsniao.te_
_________________________________________________________________
Encrypted Text Sorted By Pmf:
wzls_ug.hokfcxpqrit-mybvn,a?jde
_________________________________________________________________
Alphabeth Mapping:
abcdefghijklmnopqrstuvwxyz_-,.?
oswe_mkplt,qribgcu-yxn?fhzjdav.
_________________________________________________________________
Decoded message Alphabeth Sorted By Pmf:
z?jq-xkvpb,mwfcgulydrhnsiao.te_
_________________________________________________________________
Decrypted Text:
tie_n.gaoh_oeben_arr.yed_a_tn.uvre_hm.t_t._negaso_hsgmrc_t._ab.sd
_w.sow_t._yan_.ben_st,_velauhe_tiec_koey_tiat_yanh_d.oxt_-uht_w._
ayac,_tiec_ane_.orc_m.htm.oed_t._h.ge.oe_erhexh_adbaotawep_tienef
.ne,_tiec_gade_yan_ysti_misrsm_aod_aots.liuh_so_wneele,_so_.nden_
o.t_t._iabe_t._fswit_tieg_so_starcppp_tiec_oeben_yeot_vc_tiat_hac
sow_yisli_c.u_l.ohtaotrc_iean_fn.g_tie_yshealneh_.f_.un_dac,_tiat
_tsge_iearh_arr_tisowhp_tiec_tnuhted_natien_tiesn_.yo_lianalten_a
od_mnudeole_j_ko.ysow_menfeltrc_yerr_tiat_tsge_l.otasoh_tie_heedh
_.f_arr_tisowh,_w..d_ah_yerr_ah_vadp_st_.uwit_t._ve_negegvened_ti
at_tiene_sh_o.tisow_g.ne_dsffslurt_t._take_so_iaod,_g.ne_mensr.uh
_t._l.odult,_.n_g.ne_uolentaso_so_sth_hullehh,_tiao_t._take_tie_r
ead_so_tie_sotn.dults.o_.f_a_oey_.nden_.f_tisowhp_velauhe_tie_soo
.bat.n_iah_f.n_eoegseh_arr_ti.he_yi._iabe_d.oe_yerr_uoden_tie_.rd
_l.odsts.oh,_aod_rukeyang_defeodenh_so_ti.he_yi._gac_d._yerr_uode
n_tie_oeyp_tish_l..roehh_ansheh_mantrc_fn.g_fean_.f_tie_.mm.oeoth
,_yi._iabe_tie_rayh_.o_tiesn_hsde,_aod_mantrc_fn.g_tie_solnedurst
c_.f_geo_yi._d._o.t_neadsrc_versebe_so_oey_tisowh_uotsr_tiec_iabe
_iad_a_r.ow_eqmenseole_.f_tiegp
Ferro Demetrio, Minetto Alex Page 8 of 19
Cryptography Homeworks
Then we proceeded by manually adjusting the permutation to get a better estimation:
_________________________________________________________________
Alphabeth Mapping:
abcdefghijklmnopqrstuvwxyz_-,.?
nige_pk.ct,xlhvmyujwqr?fsz-dabo
_________________________________________________________________
Decoded message Alphabeth Sorted By Pmf:
z?jx-qkb.v,pgfmuycwdlsirhanote_
_________________________________________________________________
Decrypted Text:
the_romans_never_allowed_a_trouble_spot_to_remain_simply_to_avoid
_going_to_war_over_it,_because_they_knew_that_wars_donqt_just_go_
away,_they_are_only_postponed_to_someone_elseqs_advantage._theref
ore,_they_made_war_with_philip_and_antiochus_in_greece,_in_order_
not_to_have_to_fight_them_in_italy..._they_never_went_by_that_say
ing_which_you_constantly_hear_from_the_wiseacres_of_our_day,_that
_time_heals_all_things._they_trusted_rather_their_own_character_a
nd_prudence_-_knowing_perfectly_well_that_time_contains_the_seeds
_of_all_things,_good_as_well_as_bad._it_ought_to_be_remembered_th
at_there_is_nothing_more_difficult_to_take_in_hand,_more_perilous
_to_conduct,_or_more_uncertain_in_its_success,_than_to_take_the_l
ead_in_the_introduction_of_a_new_order_of_things._because_the_inn
ovator_has_for_enemies_all_those_who_have_done_well_under_the_old
_conditions,_and_lukewarm_defenders_in_those_who_may_do_well_unde
r_the_new._this_coolness_arises_partly_from_fear_of_the_opponents
,_who_have_the_laws_on_their_side,_and_partly_from_the_incredulit
y_of_men_who_do_not_readily_believe_in_new_things_until_they_have
_had_a_long_experience_of_them.
Ferro Demetrio, Minetto Alex Page 9 of 19
Cryptography Homeworks
Further Comments
First of all, we could observe that Ceaser ciphering encryption scheme is very weak, it can
be broken easily by using occurrence analysis.
One could expect that the Permutation of the alphabet makes it stronger, since the
permutation operation may be more difficult to invert.
This is not so true, since, from what we have seen, even if the permutation is applied, the
probability mass function is preserved, but the order is not the same.
If we consider the sorted pmf, they look a lot like each other.
The estimation of the permutation rule ˆΠ(·) is as much close to the true one Π(·), as the
pmf of the encrypted message P(E) is close to the English one P(T ).
In order to reach easily a good estimation, one may think to try clever character
swappings, and use the Kullback-Leibler Divergence as a metric for the implementation of
an algorithm that hopefully converges to the right computation of the permutation rule.
In order to make the system more robust, one may think to let the text be stronger to
occurrences analysis attacks. For example, one thing that could be done is to substitute a
given character (maybe one of the most recurrent) with a predefined character, (by setting
proper rules) in order to let the encrypted text’s pmf be uniform.
By doing this, the encrypting system may, in our opinion, be more robust to this kind of
attacks.
Moreover, in order to try if the pmf of the encrypted message makes it weak - in the sense
of occurrence analysis attacks - one may think to compress the message: if the pmf is
uniform enough, the size of the message will not decrease that much, and this may be
helpful for its security.
Ferro Demetrio, Minetto Alex Page 10 of 19
Cryptography Homeworks
Homework 2 - LFSR Stream Ciphering Encryption using key
encrypted with ElGamal PK based on Elliptic Curves
Assignment
Decrypt the message:
1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1,
1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1,
1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1,
1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1 ...
that Alice sent to Bob encrypted using stream cipher.
The stream generator consists of a pair of binary LFSRs followed by an output NLF
defined over F2.
Fibonacci LFSR:
F(x) = x23
+ x20
+ x19
+ x15
+ x12
+ x8
+ x7
+ x6
+ x5
+ x4
+ x2
+ x + 1
Galois LFSR:
G(x) = x23
+ x21
+ x19
+ x18
+ x17
+ x15
+ x12
+ x10
+ x9
+ x6
+ x5
+ x3
+ 1
Output:
NLF = x2 · x10 · y7 · y16 + x1 · x5 + y1 · x7 + y23 mod 2
where the variables xi are taken from the Fibonacci LFSR and the variables yi from the
Galois LFSR. Both LFSRs have the same initial state (from left to right) which is specified
by a binary secret key represented, for its encryption, as an integer:
Ks = b1 + b22 + b322
+ · · · + b19218
Ks was encrypted using the ElGamal public-key system based on the elliptic curve defined
over Fp as:
y2
= x3
+ x2
+ 50x + 251
Known informations about the Elliptic curve are:
Modulo: p = 186733 Message key: PB = (64236, 69780)
Generator point: P0 = (15, 24353) Alice’s secret key: ASK = [0110101000111011];
Encrypted Secret Key: ek = Ks · Xcom mod p = 83533
Ferro Demetrio, Minetto Alex Page 11 of 19
Cryptography Homeworks
Problem Statement
The stream ciphering system works with two different LFSR schemes: the Fibonacci and
Galois ones. A subset of their memory cell’s output is used to generate a stream by non
linear combination whose rule is defined by a Non Linear Function (NLF).
Such a stream is then used as ciphering key for the Plain Text Message.
The two LFSRs are both initialized by the same starting state Ks that Alice sends to Bob
by using elliptic curves based ElGamal Encryption system.
Bob Channel Alice
- Chooses his private key BSK < p
- Computes his public key PB → - Retrieves Bob’s public key PB
PB = BSK · P0, - Chooses her private key ASK < p
- Computes PAB = ASK · PB
- Takes only the coordinate Xcom
from PAB = (Xcom, Ycom)
- Retrieves Alice’s secret key PA ← PA - Encrypts the message by using the
and the encrypted key ek ← ek Encryption rule: ek = Ks · Xcom
- Computes PBA = BSK · PA = PAB
- Takes only the coordinate Xcom
from PAB = (Xcom, Ycom)
- Decrypts the message inverting the
Encryption rule: Ks = ek
Xcom
mod p
The system works with the following known parameters:
- Elliptic curve equation: y2
= x3
+ x2
+ 50x + 251
- Order of the Group Fp of use: p = 186733
- Initial Point: P0 = (15, 24353)
As a general convention, the Public Keys PA and PB are not sent over the channel but are
retrievable from a shared directory.
The security of the system is provided by the elliptic curve’s implementation of ElGamal
public key system. If the plain starting state of the LFSRs was sent over the channel, the
ciphering stream would be weaker.
Implementing Elliptic curves cryptosystem, whatever information sent over the channel is
more protected, since its strength requires large primes factorization.
Ferro Demetrio, Minetto Alex Page 12 of 19
Cryptography Homeworks
Elliptic Curves Implementation
Starting from the general equation for Elliptic curves over Fp:
E(x, y) : y2
+ a1xy + a3y = x3
+ a2x2
+ a4x + a6 (1)
We may define the Doubling rule and the Addition rule for points over the elliptic curve.
Doubling rule : 2(x1, y1) = (x3, y3)
Intercepting the line with equation: (y − y1) = m(x − x1).



y = m(x − x1) + y1
y2
+ a1xy + a3y = x3
+ a2x2
+ a4x + a6
(2)
Leads to the following derivation:
(m(x − x1) + y1)2
+ a1x(m(x − x1) + y1) + a3y = x3
+ a2x2
+ a4x + a6
m2
(x − x1)2
+ y2
1 + 2m(x − x1)y1 + a1x2
m − a1xmx1 + a1xy1 + a3y = x3
+ a2x2
+ a4x + a6
m2
x2
+m2
x2
1−2m2
xx1+y2
1+2mxy1−2mx1y1+a1x2
m−a1xmx1+a1xy1+a3y = x3
+a2x2
+a4x+a6
x3
−(m2
+a1m−a2)x2
+(2m2
x1−2my1+a1mx1−a1y1+a4)x−(m2
x2
1+y2
1−2mx1y1+a3y−a6) = 0
(3)
from Vieta’s formulas, we know that, a Polynomial of degree 3: p(x) = ax3
+ bx2
+ cx + d,
with roots x1, x2, x3 has coefficient b = x1 + x2 + x3. From this, we have:
m2
+ a1m − a2 = x1 + x2 + x3 (4)
The roots of the polynomial in Equation (3) belong to three points on the Elliptic Curve:
x1, x2 are the abscissa of the point we are doubling, x3 is the abscissa of the point we are
looking for.
All we need to know is m, that can be obtained by derivation, since it represents the
gradient of the tangent of the line in the point where it intersects the curve:
∂y
∂x
=
∂E(x, y)/∂x
∂E(x, y)/∂y
=
3x2
+ 2a2x + a4 − a1y
2y + a1x + a3
. (5)
The actual value of m has to be computed by evaluating the gradient in the point (x1, y1):
m =
∂y
∂x x=x1,y=y1
=
3x2
1 + 2a2x1 + a4 − a1y1
2y1 + a1x1 + a3
mod p (6)
Ferro Demetrio, Minetto Alex Page 13 of 19
Cryptography Homeworks
Knowing m, from Equation (4) we may think to solve for x3, y3:



x3 = m2
+ a1m − a2 − 2x1 mod p
y3 = −(y1 + m(x3 − x1)) mod p
(7)
We solve the intersection of the line with the equation of the elliptic curve.
Addition rule : (x1, y1) + (x2, y2) = (x3, y3)
At the same way, it is done by intercepting the line with equation: (y − y1) = m(x − x1).
The Derivation (3) is still valid, hence the Equation (4) leads to the computation of x3.
This time m is known from the equation of the line crossing two points:
m =
y2 − y1
x2 − x1
mod p (8)
Knowing m, we solve again for x3, y3:



x3 = m2
+ a1m − a2 − x1 − x2 mod p
y3 = −(y1 + m(x3 − x1)) mod p
(9)
We solve the intersection of the line with the equation of the elliptic curve.
Rules of Interest
In our specific case, work over F186733 on the curve of equation:
E(x, y) : y2
= x3
+ x2
+ 50x + 251 (10)
That’s what we had before with: a1 = 0, a2 = 1, a3 = 0, a4 = 50, a6 = 251.
Doubling: 2(x1, y1) = (x3, y3) Addition: (x1, y1) + (x2, y2) = (x3, y3)



m =
3x2
1 + 2x1 + 50
2y1
mod186733
x3 = m2
− 1 − 2x1 mod186733
y3 = −(y1 + m(x3 − x1)) mod186733



m =
y2 − y1
x2 − x1
mod186733
x3 = m2
− 1 − x1 − x2 mod186733
y3 = −(y1 + m(x3 − x1)) mod186733
(11)
The encryption key can be found by considering the rules of interest for Alice’s secret key
ASK starting from the point Pm.
PAB =
15
i=0
2i
· ASK(i) · PB = 56406 · PB
The computation can be derived in a easier way by applying iteratively the doubling rule,
then summing the points.
Ferro Demetrio, Minetto Alex Page 14 of 19
Cryptography Homeworks
x
-4 -2 0 2 4 6
y
-30
-20
-10
0
10
20
30
y2
= x3
+ x2
+ 50x + 251
P2 = (x2, y2)
P1 = (x1, y1)
P3 = (x3, y3)
¯P3 = (x3, −y3)
Figure 2: Elliptic Curve Additon Rule
20
· PB = (64236, 69780)
21
· PB = 2 · (64236, 69780) = (48020, 125549)
22
· PB = 2 · (48020, 125549) = (175330, 47928)
23
· PB = 2 · (175330, 47928) = (75937, 71730)
24
· PB = 2 · (75937, 71730) = (72852, 138370)
25
· PB = 2 · (72852, 138370) = (63618, 161)
26
· PB = 2 · (63618, 161) = (56218, 93364)
27
· PB = 2 · (56218, 93364) = (12054, 68385)
28
· PB = 2 · (12054, 68385) = (64182, 46455)
29
· PB = 2 · (64182, 46455) = (50647, 66194)
210
· PB = 2 · (50647, 66194) = (23960, 824)
211
· PB = 2 · (23960, 824) = (78063, 149336)
212
· PB = 2 · (78063, 149336) = (135873, 15725)
213
· PB = 2 · (135873, 15725) = (2026, 123847)
214
· PB = 2 · (2026, 123847) = (15708, 84839)
215
· PB = 2 · (15708, 84839) = (176136, 128991)
Ferro Demetrio, Minetto Alex Page 15 of 19
Cryptography Homeworks
X ×104
0 2 4 6 8 10 12 14 16 18
Y
×104
0
5
10
15
Pcom = (Xcom, Ycom)
Figure 3: Set of points obtained by doubling PB represented over F2
p.
PAB = (Xcom, Ycom) = 56406 · PB
= (2 + 4 + 16 + 64 + 1024 + 2048 + 4096 + 16384 + 32768) · PB
= 21
· PB + 22
· PB + 24
· PB + 26
· PB + 210
· PB
+211
· PB + 212
· PB + 214
· PB + 215
· PB
= (27910, 6518)
Once found the value assumed by Xcom = 27910, we could retrieve the initial state for the
LFSR Ks, by inverting its relationship with ek.
Ks =
ek
Xcom
mod p = 116211,
Finding the inverse of Xcom in modp was made by solving Diophantine equations.
To solve the equation:
Xcom · X−1
com = 1 mod p
We just considered that Xcom and p are relatively prime: gcd(Xcom, p) = 1,
They satisfy B´ezout’s identity: uXcom + vp = 1 where u, v ∈ Fp can be easily computed.
Since the operations are over Fp, the previous equation becomes: u · Xcom = 1 mod p,
hence the value u that we find using gcd is equal to X−1
com = u.
Ferro Demetrio, Minetto Alex Page 16 of 19
Cryptography Homeworks
LFSR Implementation
Once we have found the starting state Ks = 116211 in decimal form by decrypting Alice’s
secret message ek, we need to read it in binary form in order to use it as starting state for
LFSRs, padding it to fit the size of the whole registers.
Ks = (116211)2 = b1 + b2 · 2 + b3 · 22
+ · · · + b19 · 218
+ · · · b23 · 222
;
¯x(0) = {bi}23
i=1 = [ 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ]T
;
¯y(0) = {bi}23
i=1 = [ 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ]T
;
We implemented LFSRs shift by using matrices represent1ation:
AF =














0 1 0 0 · · · 0
0 0 1 0 · · · 0
0 0 0 1 · · · 0
0 0 0 0 · · · 0
0 0 0 0 · · · 0
...
...
...
...
...
...
am am−1 am−2 am−3 · · · a1














AG =














0 0 0 0 · · · am
1 0 0 0 · · · am−1
0 1 0 0 · · · am−2
0 0 1 0 · · · am−3
0 0 0 1 · · · am−4
...
...
...
...
...
...
0 0 0 0 · · · a1














By doing the following operation, we get iteratively the state update ¯x(n) for each state
transition n so that we generate a stream of length N which is the size of the encrypted
message in binary form.
¯x(n) = AF · ¯x(n − 1) ¯y(n) = AG · ¯y(n − 1)
Once we have generated the output streams: ¯x(n), ¯y(n), ∀n = 0, · · · , N − 1, we have
applied the NLF function by by combining a subset of elements of each stream by the
following rule:
NLF(¯x(n), ¯y(n)) = x2(n) · x10(n) · y7(n) · y16(n) + x1(n) · x5(n) + y1(n) · x7(n) + y23(n);
At the end, Bob can finally obtain the plaintext binary stream in order to read the Plain
Text Message as shown in Figure .
E(n) = NLF(n) ⊕ M(n)
is inverted easily by doing:
M(n) = NLF(n) ⊕ E(n)
Since a simple 5 bits binary coding rule is applied to the plain text in character form, Bob
has to read blocks of 5 bits and decode them using the relative mapping table.
Ferro Demetrio, Minetto Alex Page 17 of 19
Cryptography Homeworks
LFSR1
LFSR2
...
LFSRn
FSM
NLF ⊕
M(n)
E(n)
ECC(K) LFSR1
LFSR2
...
LFSRn
FSM
NLF⊕
Alice Channel Bob
Figure 4: Stream Ciphering with Key encryption basic model
LFSR1 (Fibonacci)
LFSR2 (Galois)
NLF(n)
x1
a23
x2
a22
x3
a21
x4
a20
x5
a19
x6
a18
x7
a17
x8
a16
x9
a15
x10
a14
x11
a13
x12
a12
x13
a11
x14
a10
x15
a9
x16
a8
x17
a7
x18
a6
x19
a5
x20
a4
x21
a3
x22
a2
x23
a1
⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕
y1
a23
y2
a22
y3
a21
y4
a20
y5
a19
y6
a18
y7
a17
y8
a16
y9
a15
y16
a8
y23
a1
⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ · · · · · · ⊕
NLF(n) = x2(n) · x10(n) · y7(n) · y16(n) + x1(n) · x5(n) + y1(n) · x7(n) + y23(n)
Figure 5: NLF Fibonacci, LFSR Galois and NLF visualization.
Ferro Demetrio, Minetto Alex Page 18 of 19
Cryptography Homeworks
Results
The Output of the NLF function is the following:
0 1 0 0 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 0 0
1 1 1 0 1 0 1 1 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 1
0 1 0 0 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 1
1 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0
0 1 0 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1
0 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 0 1 0 1
0 0 1 0 0 1 0 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 0 0 0 0
1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 1 0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 0
1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1
1 0 1 0 1 0 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0
0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1
0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 0
0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 1
1 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1
1 0 0 0 0 1 0 1 1 1 1 1 0 0 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1
1 0 0 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 0 0 0
0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 1 1 1 0
1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0
1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1
1 0 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1
The final output of the decryption is:
“true education makes for inequality: the inequality of individuality,
the inequality of success, the glorious inequality of talent, of genius.
felix e. schelling american educator.”
Ferro Demetrio, Minetto Alex Page 19 of 19

More Related Content

What's hot

ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-
ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-
ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-ssusere0a682
 
Tokyo APAC Groundbreakers tour - The Complete Java Developer
Tokyo APAC Groundbreakers tour - The Complete Java DeveloperTokyo APAC Groundbreakers tour - The Complete Java Developer
Tokyo APAC Groundbreakers tour - The Complete Java DeveloperConnor McDonald
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeChung Hua Universit
 
2.7 chain rule short cuts
2.7 chain rule short cuts2.7 chain rule short cuts
2.7 chain rule short cutsmath265
 
GraphBLAS: A linear algebraic approach for high-performance graph queries
GraphBLAS: A linear algebraic approach for high-performance graph queriesGraphBLAS: A linear algebraic approach for high-performance graph queries
GraphBLAS: A linear algebraic approach for high-performance graph queriesGábor Szárnyas
 
Equation of linear regression straight line
Equation of linear regression straight lineEquation of linear regression straight line
Equation of linear regression straight lineWaleed Zaghal
 
ゲーム理論BASIC 演習6 -仁を求める-
ゲーム理論BASIC 演習6 -仁を求める-ゲーム理論BASIC 演習6 -仁を求める-
ゲーム理論BASIC 演習6 -仁を求める-ssusere0a682
 
The Ring programming language version 1.5.3 book - Part 69 of 184
The Ring programming language version 1.5.3 book - Part 69 of 184The Ring programming language version 1.5.3 book - Part 69 of 184
The Ring programming language version 1.5.3 book - Part 69 of 184Mahmoud Samir Fayed
 
ゲーム理論BASIC 第34回 -続・安定集合-
ゲーム理論BASIC 第34回 -続・安定集合-ゲーム理論BASIC 第34回 -続・安定集合-
ゲーム理論BASIC 第34回 -続・安定集合-ssusere0a682
 
ゲーム理論BASIC 演習5 -カーネルを求める-
ゲーム理論BASIC 演習5 -カーネルを求める-ゲーム理論BASIC 演習5 -カーネルを求める-
ゲーム理論BASIC 演習5 -カーネルを求める-ssusere0a682
 
Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014PyData
 
ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-
ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-
ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-ssusere0a682
 
ゲーム理論BASIC 演習4 -交渉集合を求める-
ゲーム理論BASIC 演習4 -交渉集合を求める-ゲーム理論BASIC 演習4 -交渉集合を求める-
ゲーム理論BASIC 演習4 -交渉集合を求める-ssusere0a682
 
How to recover malare assembly codes
How to recover malare assembly codesHow to recover malare assembly codes
How to recover malare assembly codesFACE
 
The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202Mahmoud Samir Fayed
 
Taylor's & Maclaurin's series simple
Taylor's & Maclaurin's series simpleTaylor's & Maclaurin's series simple
Taylor's & Maclaurin's series simpleNikhilkumar Patel
 

What's hot (20)

ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-
ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-
ゲーム理論BASIC 第45回補足 -公理から求めるシャープレイ値-
 
Serpent sboxes
Serpent sboxesSerpent sboxes
Serpent sboxes
 
Tokyo APAC Groundbreakers tour - The Complete Java Developer
Tokyo APAC Groundbreakers tour - The Complete Java DeveloperTokyo APAC Groundbreakers tour - The Complete Java Developer
Tokyo APAC Groundbreakers tour - The Complete Java Developer
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
 
maths ppt.pdf
maths ppt.pdfmaths ppt.pdf
maths ppt.pdf
 
2.7 chain rule short cuts
2.7 chain rule short cuts2.7 chain rule short cuts
2.7 chain rule short cuts
 
GraphBLAS: A linear algebraic approach for high-performance graph queries
GraphBLAS: A linear algebraic approach for high-performance graph queriesGraphBLAS: A linear algebraic approach for high-performance graph queries
GraphBLAS: A linear algebraic approach for high-performance graph queries
 
Equation of linear regression straight line
Equation of linear regression straight lineEquation of linear regression straight line
Equation of linear regression straight line
 
ゲーム理論BASIC 演習6 -仁を求める-
ゲーム理論BASIC 演習6 -仁を求める-ゲーム理論BASIC 演習6 -仁を求める-
ゲーム理論BASIC 演習6 -仁を求める-
 
The Ring programming language version 1.5.3 book - Part 69 of 184
The Ring programming language version 1.5.3 book - Part 69 of 184The Ring programming language version 1.5.3 book - Part 69 of 184
The Ring programming language version 1.5.3 book - Part 69 of 184
 
ゲーム理論BASIC 第34回 -続・安定集合-
ゲーム理論BASIC 第34回 -続・安定集合-ゲーム理論BASIC 第34回 -続・安定集合-
ゲーム理論BASIC 第34回 -続・安定集合-
 
ゲーム理論BASIC 演習5 -カーネルを求める-
ゲーム理論BASIC 演習5 -カーネルを求める-ゲーム理論BASIC 演習5 -カーネルを求める-
ゲーム理論BASIC 演習5 -カーネルを求める-
 
Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014Crushing the Head of the Snake by Robert Brewer PyData SV 2014
Crushing the Head of the Snake by Robert Brewer PyData SV 2014
 
ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-
ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-
ゲーム理論BASIC 演習34 -公理から求めるシャープレイ値-
 
ゲーム理論BASIC 演習4 -交渉集合を求める-
ゲーム理論BASIC 演習4 -交渉集合を求める-ゲーム理論BASIC 演習4 -交渉集合を求める-
ゲーム理論BASIC 演習4 -交渉集合を求める-
 
How to recover malare assembly codes
How to recover malare assembly codesHow to recover malare assembly codes
How to recover malare assembly codes
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202
 
Taylor's & Maclaurin's series simple
Taylor's & Maclaurin's series simpleTaylor's & Maclaurin's series simple
Taylor's & Maclaurin's series simple
 
Liquid Haskell: Theorem Proving for All
Liquid Haskell: Theorem Proving for AllLiquid Haskell: Theorem Proving for All
Liquid Haskell: Theorem Proving for All
 

Viewers also liked

Cryptography full report
Cryptography full reportCryptography full report
Cryptography full reportharpoo123143
 
Cryptanalysis Project Report
Cryptanalysis Project ReportCryptanalysis Project Report
Cryptanalysis Project Reportshahparin
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
steganography using visual cryptography_report
steganography using visual cryptography_reportsteganography using visual cryptography_report
steganography using visual cryptography_reportSaurabh Nambiar
 
A Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman ProblemA Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman Problemvsubhashini
 
Security using colors and armstrong numbers by sravanthi (lollypop)
Security using colors and armstrong numbers by sravanthi (lollypop)Security using colors and armstrong numbers by sravanthi (lollypop)
Security using colors and armstrong numbers by sravanthi (lollypop)Ashok Reddy
 
Crypto-Book SOSP WIP
Crypto-Book SOSP WIPCrypto-Book SOSP WIP
Crypto-Book SOSP WIPmahan9
 
Crypto-Book: Document leakage
Crypto-Book: Document leakageCrypto-Book: Document leakage
Crypto-Book: Document leakagemahan9
 
Crypto-Book slides
Crypto-Book slidesCrypto-Book slides
Crypto-Book slidesmahan9
 
Hotnets Slides
Hotnets SlidesHotnets Slides
Hotnets Slidesmahan9
 
Crypto-Book Hotnets
Crypto-Book HotnetsCrypto-Book Hotnets
Crypto-Book Hotnetsmahan9
 
Data Hiding Techniques
Data Hiding TechniquesData Hiding Techniques
Data Hiding Techniquesprashant3535
 
Ensuring data security in cloud computing. - Anusha Tuke
Ensuring data security in  cloud computing. - Anusha TukeEnsuring data security in  cloud computing. - Anusha Tuke
Ensuring data security in cloud computing. - Anusha TukeAnusha Chavan
 
Steganography Project
Steganography Project Steganography Project
Steganography Project Uttam Jain
 

Viewers also liked (20)

Cryptography full report
Cryptography full reportCryptography full report
Cryptography full report
 
Cryptanalysis Project Report
Cryptanalysis Project ReportCryptanalysis Project Report
Cryptanalysis Project Report
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
steganography using visual cryptography_report
steganography using visual cryptography_reportsteganography using visual cryptography_report
steganography using visual cryptography_report
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
A Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman ProblemA Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman Problem
 
Security using colors and armstrong numbers by sravanthi (lollypop)
Security using colors and armstrong numbers by sravanthi (lollypop)Security using colors and armstrong numbers by sravanthi (lollypop)
Security using colors and armstrong numbers by sravanthi (lollypop)
 
Crypto-Book SOSP WIP
Crypto-Book SOSP WIPCrypto-Book SOSP WIP
Crypto-Book SOSP WIP
 
Crypto-Book: Document leakage
Crypto-Book: Document leakageCrypto-Book: Document leakage
Crypto-Book: Document leakage
 
Crypto-Book slides
Crypto-Book slidesCrypto-Book slides
Crypto-Book slides
 
Hotnets Slides
Hotnets SlidesHotnets Slides
Hotnets Slides
 
Crypto-Book Hotnets
Crypto-Book HotnetsCrypto-Book Hotnets
Crypto-Book Hotnets
 
Arvind stegnography
Arvind stegnographyArvind stegnography
Arvind stegnography
 
Stegnography
StegnographyStegnography
Stegnography
 
Data Hiding Techniques
Data Hiding TechniquesData Hiding Techniques
Data Hiding Techniques
 
Ensuring data security in cloud computing. - Anusha Tuke
Ensuring data security in  cloud computing. - Anusha TukeEnsuring data security in  cloud computing. - Anusha Tuke
Ensuring data security in cloud computing. - Anusha Tuke
 
Steganography Project
Steganography Project Steganography Project
Steganography Project
 
Cryptography
CryptographyCryptography
Cryptography
 

Similar to Cryptography Homeworks decryption using statistical analysis

Study on a class of recursive functions
Study on a class of recursive functionsStudy on a class of recursive functions
Study on a class of recursive functionsLuca Polidori
 
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920Karl Rudeen
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionPriSim
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationAlexander Litvinenko
 
Theoryofcomp science
Theoryofcomp scienceTheoryofcomp science
Theoryofcomp scienceRaghu nath
 
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAAhmed Gamal Abdel Gawad
 
Introdution to differential forms
Introdution to differential formsIntrodution to differential forms
Introdution to differential formsDunga Pessoa
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpExcel Homework Help
 
Museum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docxMuseum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docxgilpinleeanna
 
Skiena algorithm 2007 lecture17 edit distance
Skiena algorithm 2007 lecture17 edit distanceSkiena algorithm 2007 lecture17 edit distance
Skiena algorithm 2007 lecture17 edit distancezukun
 
maXbox starter67 machine learning V
maXbox starter67 machine learning VmaXbox starter67 machine learning V
maXbox starter67 machine learning VMax Kleiner
 
Hidden Markov Model in Natural Language Processing
Hidden Markov Model in Natural Language ProcessingHidden Markov Model in Natural Language Processing
Hidden Markov Model in Natural Language Processingsachinmaskeen211
 
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Alexander Litvinenko
 

Similar to Cryptography Homeworks decryption using statistical analysis (20)

Study on a class of recursive functions
Study on a class of recursive functionsStudy on a class of recursive functions
Study on a class of recursive functions
 
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
fb69b412-97cb-4e8d-8a28-574c09557d35-160618025920
 
Project Paper
Project PaperProject Paper
Project Paper
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
 
E E 481 Lab 1
E E 481 Lab 1E E 481 Lab 1
E E 481 Lab 1
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th edition
 
Asymptote Curve I
Asymptote Curve IAsymptote Curve I
Asymptote Curve I
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty Quantification
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Theoryofcomp science
Theoryofcomp scienceTheoryofcomp science
Theoryofcomp science
 
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
 
Introdution to differential forms
Introdution to differential formsIntrodution to differential forms
Introdution to differential forms
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
 
Group01_Project3
Group01_Project3Group01_Project3
Group01_Project3
 
Museum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docxMuseum Paper Rubric50 pointsRubric below is a chart form of .docx
Museum Paper Rubric50 pointsRubric below is a chart form of .docx
 
Skiena algorithm 2007 lecture17 edit distance
Skiena algorithm 2007 lecture17 edit distanceSkiena algorithm 2007 lecture17 edit distance
Skiena algorithm 2007 lecture17 edit distance
 
maXbox starter67 machine learning V
maXbox starter67 machine learning VmaXbox starter67 machine learning V
maXbox starter67 machine learning V
 
Hidden Markov Model in Natural Language Processing
Hidden Markov Model in Natural Language ProcessingHidden Markov Model in Natural Language Processing
Hidden Markov Model in Natural Language Processing
 
RiemannTEX
RiemannTEXRiemannTEX
RiemannTEX
 
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
Computation of Electromagnetic Fields Scattered from Dielectric Objects of Un...
 

Recently uploaded

Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksSérgio Sacani
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSarthak Sekhar Mondal
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsSérgio Sacani
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physicsvishikhakeshava1
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfnehabiju2046
 
Cultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxCultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxpradhanghanshyam7136
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡anilsa9823
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCEPRINCE C P
 
Orientation, design and principles of polyhouse
Orientation, design and principles of polyhouseOrientation, design and principles of polyhouse
Orientation, design and principles of polyhousejana861314
 
G9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptG9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptMAESTRELLAMesa2
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...anilsa9823
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxkessiyaTpeter
 
Caco-2 cell permeability assay for drug absorption
Caco-2 cell permeability assay for drug absorptionCaco-2 cell permeability assay for drug absorption
Caco-2 cell permeability assay for drug absorptionPriyansha Singh
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxAArockiyaNisha
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfmuntazimhurra
 

Recently uploaded (20)

Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physics
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdf
 
Cultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxCultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptx
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
 
Orientation, design and principles of polyhouse
Orientation, design and principles of polyhouseOrientation, design and principles of polyhouse
Orientation, design and principles of polyhouse
 
G9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptG9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.ppt
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
 
Caco-2 cell permeability assay for drug absorption
Caco-2 cell permeability assay for drug absorptionCaco-2 cell permeability assay for drug absorption
Caco-2 cell permeability assay for drug absorption
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdf
 

Cryptography Homeworks decryption using statistical analysis

  • 2. Cryptography Homeworks Contents Homework 1 1 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Cryptanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Further Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Homework 2 10 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Elliptic Curves Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 LFSR Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Ferro Demetrio, Minetto Alex
  • 3. Cryptography Homeworks Homework 1 - Caesar code with permuted alphabet Assignment Decrypt the following message which has been encrypted using Caeser cipher with the al- phabet letters in a permuted order that is part of the secret key. 9, 13, 3, 4, 21, 30, 15, 28, 0, 24, 4, 0, 3, 14, 3, 21, 4, 28, 12, 12, 30, 19, 3, 27, 4, 28, 4, 9, 21, 30, 17, 29, 12, 3, 4, 24, 5, 30, 9, 4, 9, 30, 4, 21, 3, 15, 28, 1, 0, 4, 24, 1, 15, 5, 12, 16, 4, 9, 30, 4, 28, 14, 30, ... The frequencies of the 26 alphabet letters plus 5 special characters (i.e. blank and punctua- tion marks) are orderly encoded as two digit numbers from 0 to 25, and: ”blank” is encoded as 26, ”-” is encoded as 27, ”,” is encoded as 28, ”.” is encoded as 29, ”;” is encoded as 30, are: "a", 5.856417935 "b", 0.915065302 "c", 1.746994285 "d", 3.161113468 "e", 8.734714250 "f", 1.622161218 "g", 1.688711422 "h", 4.999584061 "i", 5.814824058 "j", 0.116462856 "k", 0.457532651 "l", 2.753514683 "m", 1.256135097 "n", 5.606854671 "o", 6.239081607 "p", 0.873471425 "q", 0.066550200 "r", 3.660261209 "s", 5.257466101 "t", 7.528491806 "u", 2.104650195 "v", 0.856833874 "w", 1.514017137 "x", 0.124781632 "y", 3.105981199 "z", 0.058231428 " ", 15.97728974 "-", 0.066550200 ",", 1.081440812 ".", 6.738208136 "?", 0.016637550 Ferro Demetrio, Minetto Alex Page 1 of 19
  • 4. Cryptography Homeworks Problem Statement Caeser cipher encrypting systems are usually based on a circular shift of the reference al- phabet A, generating a new set Aσ, containing all the elements of A shifted by σ positions. In our case, we have a further permutation of the resulting shifted alphabet, call it Aσπ0 . Considering the set: A := {an}30 n=0 ≡ { a b c d e f g h i j k l m n o p q r s t u v w x y z − , . ? } By applying Caeser ciphering Σ(·, σ) with σ = 3 we get to Aσ = Σ(A, σ), for every an, we define am = an+σ ∀m, n = 0, · · · , 30 : Aσ := {am}30 m=0 ≡ { d e f g h i j k l m n o p q r s t u v w x y z − , . ? a b c } By applying a permutation Π0(·) to the originary alphabeth we get to a new set Aπ0 = Π0(A). By applying the same permutation Π(·) to the shifetd alphabeth Aσ we get to a new set Aσπ0 = Π0(Aσ) = Π0(Σ(A, σ)). We wanted to exploit the fact that applying a permutation to a shifted version of the alphabet is equivalent to apply a different permutation to the original alphabeth. Calling Π the new permutation, Π = Π0(Σ(·, σ)), we get: Aσπ0 = Π0(Σ(A, σ)) = Π(A) = Aπ. This can be shown even by using characters given by the assignment. a b c d e f g h i j k l m n o p q r s t u · · · ? by applying a 3-characters shift, we get the following: d e f g h i j k l m n o p q r s t u v w x · · · c then we apply a random permutation: v f c p k . g - q n h e , u y ? z s o a · · · l the effect of the combination of the two operations may be interpreted as a single new per- mutation. Given an encrypted text obtained by doing these operations, one can not determine either the permuted version of the alphabet comes by permuting the reference alphabet or by per- muting a shifted version of it. One can ignore the knowledge of the previous permutation rule Π0(·) acting on the Caesar ciphered text, hence the knowledge of the Caesar Key σ, since they may be considered as a single permutation Π(·). Ferro Demetrio, Minetto Alex Page 2 of 19
  • 5. Cryptography Homeworks Cryptanalysis The purpose of our cryptanalysis is to identify the permuted alphabet A˜π in order to recon- struct the message by inverting the permutation: Π−1 (Aπ) = A. In order to do this, we start from the assumption that the plaintext M is written in English. Considering T an exhaustive text containing all possible English words: T := {ti ∈ A} |T | i=1, The statistics of the occurrences of each character in the text may be defined as: P(T ) = 1 |T | |T | i=1 δ(ti = an), ∀n = 0, · · · , 30. That essentially is the probability mass function of the English alphabet. Since the text was encrypted by substitution cipher, we suppose that the distribution of the occurrences of the letters does not change even if they are substituted. So, given our Encrypted message E, we computed its probability mass function P(E). P(E) = 1 |E| |E| i=1 δ(ei = an), ∀n = 0, · · · , 30. In order to find the correspondence between the occurrences of English letters and the letters of our message, we need to sort the probability mass functions (pmf), as shown in Figure 1. By doing this, we get to a new disposition of the alphabet in both cases: AT and AE, where the elements are sorted by their pmf. From the Occurrences Analysis we can extract an Estimation of the permutation ˆΠ, that can be used to determine ˆΠ−1 (E) = ˆM, with the assumption that ˆΠ Π. Since the two mass functions P(T ), P(E) may not be so reliable, due to the fact that for some characters the values assumed by the probability mass function are very close, the estimation of the permutation rule is altered. In order to reconstruct the plaintext we need to read the message applying the inverse permutation rule and try to adjust it to improve the estimation of the permutation rule. Ferro Demetrio, Minetto Alex Page 3 of 19
  • 6. Cryptography Homeworks Implementation Alphabeth0(1,:)=[1:1:31]; 2 Alphabeth0(2,:)=[’a’, ’b’, ’c’, ’d’, ’e’, ’f’,’g’, ’h’, ’i’,’j’, ’k’, ’l’,’m’, ’n’, ’o’,... ’p’, ’q’, ’r’,’s’, ’t’, ’u’,’v’, ’w’, ’x’,’y’, ’z’, ’_’,’-’, ’,’, ’.’,’?’]; 4 Alphabeth0(3,:)=[5.856417935 0.915065302 1.7469942850 3.1611134681 8.734714250 ... 1.622161218 1.688711422 4.999584061 5.814824058 0.116462856 ... 6 0.457532651 2.753514683 1.256135097 5.606854671 6.239081607 ... 0.873471425 0.06655020 3.660261209 5.257466101 7.528491806 ... 8 2.104650195 0.856833874 1.514017137 0.124781632 3.105981199 ... 0.058231428 15.97728974 0.06655020 1.081440812 6.738208136 0.016637550]/100; 10 12 %% READ FROM ENCRYPTED NUMERICAL FILE 14 %EncText(1,:)=load(’encrypted_text.txt’)+1; %EncText(1,:)=load(’EncryptedText.txt’)+1; 16 %EncText(1,:)=load(’encrypted_text.txt’)+1; 18 EncTextTemp=load(’encrypted_text.txt’)+1; %EncTextTemp=load(’EncMiltonParadiseLost.txt’)+1; 20 EncText(1,:)=EncTextTemp; EncText(2,:)=Alphabeth0(2,EncText(1,:)); 22 fprintf(’Encrypted Text:n’); 24 fprintf(’%c’,EncText(2,:)) fprintf(’n__________________________________________n’); 26 % BUILDING PERMUTED ALPHABETH - STILL HAS TO BE PERMUTED 28 AlphabethP(1,:)=Alphabeth0(1,:); AlphabethP(2,:)=Alphabeth0(2,:); 30 AlphabethP(3,:)=histc( EncText(1,:), unique(Alphabeth0(1,:)) )./length(EncText(1,:)); % conta le occorrenze delle lettere codificate in ordine alfabetico (non permutato) 32 % SORTING THE PMF IN ORDER TO GUESS THE MAPPING 34 [pmfp, indp]=sort(AlphabethP(3,:)); [pmfa, inda]=sort(Alphabeth0(3,:)); 36 fprintf(’English Alphabeth Sorted By Pmf:n’); 38 AlphabethSortedByPmf=Alphabeth0(2,inda); fprintf(’%c’,AlphabethSortedByPmf); 40 fprintf(’n__________________________________________n’); 42 fprintf(’Encrypted Text Alphabeth Sorted By Pmf:n’); EncTextSortedByPmf=Alphabeth0(2,indp); 44 fprintf(’%c’,EncTextSortedByPmf); fprintf(’n__________________________________________n’); 46 % PERMUTED ALPHABETH CONSTRUCTION - PERMUTATION IN PROGRESS 48 AlphabethP(2,:)=InterleaveText(Alphabeth0(2,:),Alphabeth0(2,indp),Alphabeth0(2,inda)); 50 % approccio statistico : MAPPING PROBABILISTICI Ferro Demetrio, Minetto Alex Page 4 of 19
  • 7. Cryptography Homeworks % e - _ 52 % d - e 54 % PERMUTED ALPHABETH - PERMUTATION BY MANUAL RECONSTRUCTION AlphabethPTrue(2,:)=double(’nige_pk.ct,xlhvmyujwqr?fsz-dabo’); 56 %AlphabethPTrue(2,:)=double(’bcdefghijklmnopqrstuvwxyz_-,.?a’); 58 % approccio manuale : SCAMBI FATTI A MANO % simboli p i certi - simboli per cui si scambia 60 % h - i % o - . 62 % n - c % r - c 64 % i - s % g - w 66 % c - l % w - m 68 % n - . % v - b 70 % w - y % y - . 72 % p - . % j - - 74 % x - q 76 AlphabethP(1,:)=TextToIndices(AlphabethP(2,:),Alphabeth0(1,:),Alphabeth0(2,:)); AlphabethP(3,:)=AlphabethP(3,AlphabethP(1,:)); 78 % COMPUTING THE NUMBER OF PERMUTATION GUESSES 80 Guesses=AlphabethP(2,AlphabethP(2,:)==double(’nige_pk.ct,xlhvmyujwqr?fsz-dabo’)); %Guesses=AlphabethP(2,AlphabethP(2,:)==double(’bcdefghijklmnopqrstuvwxyz_-,.?a’)); 82 if(˜isempty(Guesses)) GuessesSorted=Alphabeth0(2,sort(TextToIndices(Guesses,AlphabethP(1,:),AlphabethP(2,:)))); 84 end Guesses0=Alphabeth0(2,AlphabethP(2,:)==double(’nige_pk.ct,xlhvmyujwqr?fsz-dabo’)); 86 %Guesses0=Alphabeth0(2,AlphabethP(2,:)==double(’bcdefghijklmnopqrstuvwxyz_-,.?a’)); 88 fprintf(’Alphabeth Mapping:n’); fprintf(’%c’,Alphabeth0(2,:)); 90 fprintf(’n’); fprintf(’%c’,AlphabethP(2,:)); 92 fprintf(’n’); fprintf(’%c’,AlphabethPTrue(2,:)); 94 fprintf(’n__________________________________________n’); fprintf(’Guesses: %dn’,length(Guesses)); 96 if(˜isempty(Guesses))fprintf(’%c’,GuessesSorted);end; fprintf(’n__________________________________________n’); 98 % DECRYPTION BY USING THE PMF OBTAINED FROM STATISTICS 100 DecText(2,:)=InterleaveText(EncText(2,:),Alphabeth0(2,:),AlphabethP(2,:)); DecText(1,:)=TextToIndices(DecText(2,:),Alphabeth0(1,:),Alphabeth0(2,:)); 102 Ferro Demetrio, Minetto Alex Page 5 of 19
  • 8. Cryptography Homeworks % COMPUTING THE ALPHABETH DISTRIBUTION OF THE SUPPOSED PLAINTEXT 104 % IT IS DIFFERENT FROM THE ENGLISH ONE 106 AlphabethD(2,:)=InterleaveText(Alphabeth0(2,:),Alphabeth0(2,:),AlphabethP(2,:)); AlphabethD(1,:)=TextToIndices(Alphabeth0(2,:),Alphabeth0(1,:),Alphabeth0(2,:)); 108 AlphabethD(3,:)=histc(DecText(1,:),unique(AlphabethD(1,:)))./length(DecText(1,:)); char(AlphabethD(2,:)) 110 [pmfd, indd]=sort(AlphabethD(3,:)); 112 fprintf(’Decrypted message Alphabeth Sorted By Pmf:n’); 114 DecSortedByPmf=AlphabethD(2,indd); fprintf(’%c’,DecSortedByPmf); 116 fprintf(’n__________________________________________n’); 118 fprintf(’%c’,EncText(2,:)); fprintf(’n’); 120 fprintf(’%c’,DecText(2,:)); fprintf(’n’); 122 fprintf(’n__________________________________________n’); 124 % DECRYPTING BY USING MANUAL RECOSTRUCTED PERMUTATION DecTextTrue(2,:)=InterleaveText(EncText(2,:),Alphabeth0(2,:),AlphabethPTrue(2,:)); 126 DecTextTrue(1,:)=TextToIndices(DecText(2,:),Alphabeth0(1,:),Alphabeth0(2,:)); 128 % COMPUTING THE ALPHABETH DISTRIBUTION OF THE TRUE PLAINTEXT % IT IS DIFFERENT FROM THE ENGLISH ONE BUT EQUAL TO THE SUPPOSED ONE 130 AlphabethDTrue(1,:)=Alphabeth0(1,:); AlphabethDTrue(2,:)=Alphabeth0(2,:); Listing 1: Matlab Implementation Ferro Demetrio, Minetto Alex Page 6 of 19
  • 9. Cryptography Homeworks Results ? w z z q l - s j _ x u k g v . p h b o , k m f w c f x g p c q u r l i y t d - r m h y s b n v i n a , o a . ? t j e d _ e 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 Encrypted Message Occurences English Language Occurences Figure 1: Probability Mass Functions of English Language and Encrypted Text. The previously shown cryptanalysis formulation was implemented in Matlab , the output is the following: Encrypted Text: _________________________________________________________________ jndev?p,ayeadodve,mm?td-e,ejv?r.mdeyf?jej?evdp,baeybpfmqej?e,o?b- ec?bacej?et,ve?odvebjke.di,rydejndqegadtejn,jet,vye-?aujesryjec?e ,t,qkejndqe,vde?amqef?yjf?ad-ej?ey?pd?adedmyduye,-o,aj,cdhejndvdx ?vdkejndqep,-det,vetbjnefnbmbfe,a-e,ajb?inryebaecvddidkebae?v-dve a?jej?en,odej?exbcnjejndpebaebj,mqhhhejndqeadodvetdaje.qejn,jey,q bacetnbineq?rei?ayj,ajmqend,vexv?pejndetbyd,ivdye?xe?rve-,qkejn,j ejbpdend,mye,mmejnbacyhejndqejvryjd-ev,jndvejndbve?taein,v,ijdve, a-efvr-daide_ega?tbacefdvxdijmqetdmmejn,jejbpdei?aj,bayejndeydd-y e?xe,mmejnbacykec??-e,yetdmme,ye.,-hebje?rcnjej?e.devdpdp.dvd-ejn ,jejndvdebyea?jnbacep?vde-bxxbirmjej?ej,gdebaen,a-kep?vdefdvbm?ry ej?ei?a-rijke?vep?vderaidvj,baebaebjyeyriidyykejn,aej?ej,gdejndem d,-ebaejndebajv?-rijb?ae?xe,eadte?v-dve?xejnbacyhe.di,rydejndebaa Ferro Demetrio, Minetto Alex Page 7 of 19
  • 10. Cryptography Homeworks ?o,j?ven,yex?vedadpbdye,mmejn?ydetn?en,ode-?adetdmmera-dvejnde?m- ei?a-bjb?ayke,a-emrgdt,vpe-dxda-dvyebaejn?ydetn?ep,qe-?etdmmera-d vejndeadthejnbyei??madyye,vbydyef,vjmqexv?pexd,ve?xejnde?ff?adajy ketn?en,odejndem,tye?aejndbveyb-dke,a-ef,vjmqexv?pejndebaivd-rmbj qe?xepdaetn?e-?ea?jevd,-bmqe.dmbdodebaeadtejnbacyerajbmejndqen,od en,-e,em?acedlfdvbdaide?xejndph _________________________________________________________________ Alphabeth Sorted By Pmf: ?zq-jxkvpb,mwfgculydrhsniao.te_ _________________________________________________________________ Encrypted Text Sorted By Pmf: wzls_ug.hokfcxpqrit-mybvn,a?jde _________________________________________________________________ Alphabeth Mapping: abcdefghijklmnopqrstuvwxyz_-,.? oswe_mkplt,qribgcu-yxn?fhzjdav. _________________________________________________________________ Decoded message Alphabeth Sorted By Pmf: z?jq-xkvpb,mwfcgulydrhnsiao.te_ _________________________________________________________________ Decrypted Text: tie_n.gaoh_oeben_arr.yed_a_tn.uvre_hm.t_t._negaso_hsgmrc_t._ab.sd _w.sow_t._yan_.ben_st,_velauhe_tiec_koey_tiat_yanh_d.oxt_-uht_w._ ayac,_tiec_ane_.orc_m.htm.oed_t._h.ge.oe_erhexh_adbaotawep_tienef .ne,_tiec_gade_yan_ysti_misrsm_aod_aots.liuh_so_wneele,_so_.nden_ o.t_t._iabe_t._fswit_tieg_so_starcppp_tiec_oeben_yeot_vc_tiat_hac sow_yisli_c.u_l.ohtaotrc_iean_fn.g_tie_yshealneh_.f_.un_dac,_tiat _tsge_iearh_arr_tisowhp_tiec_tnuhted_natien_tiesn_.yo_lianalten_a od_mnudeole_j_ko.ysow_menfeltrc_yerr_tiat_tsge_l.otasoh_tie_heedh _.f_arr_tisowh,_w..d_ah_yerr_ah_vadp_st_.uwit_t._ve_negegvened_ti at_tiene_sh_o.tisow_g.ne_dsffslurt_t._take_so_iaod,_g.ne_mensr.uh _t._l.odult,_.n_g.ne_uolentaso_so_sth_hullehh,_tiao_t._take_tie_r ead_so_tie_sotn.dults.o_.f_a_oey_.nden_.f_tisowhp_velauhe_tie_soo .bat.n_iah_f.n_eoegseh_arr_ti.he_yi._iabe_d.oe_yerr_uoden_tie_.rd _l.odsts.oh,_aod_rukeyang_defeodenh_so_ti.he_yi._gac_d._yerr_uode n_tie_oeyp_tish_l..roehh_ansheh_mantrc_fn.g_fean_.f_tie_.mm.oeoth ,_yi._iabe_tie_rayh_.o_tiesn_hsde,_aod_mantrc_fn.g_tie_solnedurst c_.f_geo_yi._d._o.t_neadsrc_versebe_so_oey_tisowh_uotsr_tiec_iabe _iad_a_r.ow_eqmenseole_.f_tiegp Ferro Demetrio, Minetto Alex Page 8 of 19
  • 11. Cryptography Homeworks Then we proceeded by manually adjusting the permutation to get a better estimation: _________________________________________________________________ Alphabeth Mapping: abcdefghijklmnopqrstuvwxyz_-,.? nige_pk.ct,xlhvmyujwqr?fsz-dabo _________________________________________________________________ Decoded message Alphabeth Sorted By Pmf: z?jx-qkb.v,pgfmuycwdlsirhanote_ _________________________________________________________________ Decrypted Text: the_romans_never_allowed_a_trouble_spot_to_remain_simply_to_avoid _going_to_war_over_it,_because_they_knew_that_wars_donqt_just_go_ away,_they_are_only_postponed_to_someone_elseqs_advantage._theref ore,_they_made_war_with_philip_and_antiochus_in_greece,_in_order_ not_to_have_to_fight_them_in_italy..._they_never_went_by_that_say ing_which_you_constantly_hear_from_the_wiseacres_of_our_day,_that _time_heals_all_things._they_trusted_rather_their_own_character_a nd_prudence_-_knowing_perfectly_well_that_time_contains_the_seeds _of_all_things,_good_as_well_as_bad._it_ought_to_be_remembered_th at_there_is_nothing_more_difficult_to_take_in_hand,_more_perilous _to_conduct,_or_more_uncertain_in_its_success,_than_to_take_the_l ead_in_the_introduction_of_a_new_order_of_things._because_the_inn ovator_has_for_enemies_all_those_who_have_done_well_under_the_old _conditions,_and_lukewarm_defenders_in_those_who_may_do_well_unde r_the_new._this_coolness_arises_partly_from_fear_of_the_opponents ,_who_have_the_laws_on_their_side,_and_partly_from_the_incredulit y_of_men_who_do_not_readily_believe_in_new_things_until_they_have _had_a_long_experience_of_them. Ferro Demetrio, Minetto Alex Page 9 of 19
  • 12. Cryptography Homeworks Further Comments First of all, we could observe that Ceaser ciphering encryption scheme is very weak, it can be broken easily by using occurrence analysis. One could expect that the Permutation of the alphabet makes it stronger, since the permutation operation may be more difficult to invert. This is not so true, since, from what we have seen, even if the permutation is applied, the probability mass function is preserved, but the order is not the same. If we consider the sorted pmf, they look a lot like each other. The estimation of the permutation rule ˆΠ(·) is as much close to the true one Π(·), as the pmf of the encrypted message P(E) is close to the English one P(T ). In order to reach easily a good estimation, one may think to try clever character swappings, and use the Kullback-Leibler Divergence as a metric for the implementation of an algorithm that hopefully converges to the right computation of the permutation rule. In order to make the system more robust, one may think to let the text be stronger to occurrences analysis attacks. For example, one thing that could be done is to substitute a given character (maybe one of the most recurrent) with a predefined character, (by setting proper rules) in order to let the encrypted text’s pmf be uniform. By doing this, the encrypting system may, in our opinion, be more robust to this kind of attacks. Moreover, in order to try if the pmf of the encrypted message makes it weak - in the sense of occurrence analysis attacks - one may think to compress the message: if the pmf is uniform enough, the size of the message will not decrease that much, and this may be helpful for its security. Ferro Demetrio, Minetto Alex Page 10 of 19
  • 13. Cryptography Homeworks Homework 2 - LFSR Stream Ciphering Encryption using key encrypted with ElGamal PK based on Elliptic Curves Assignment Decrypt the message: 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1 ... that Alice sent to Bob encrypted using stream cipher. The stream generator consists of a pair of binary LFSRs followed by an output NLF defined over F2. Fibonacci LFSR: F(x) = x23 + x20 + x19 + x15 + x12 + x8 + x7 + x6 + x5 + x4 + x2 + x + 1 Galois LFSR: G(x) = x23 + x21 + x19 + x18 + x17 + x15 + x12 + x10 + x9 + x6 + x5 + x3 + 1 Output: NLF = x2 · x10 · y7 · y16 + x1 · x5 + y1 · x7 + y23 mod 2 where the variables xi are taken from the Fibonacci LFSR and the variables yi from the Galois LFSR. Both LFSRs have the same initial state (from left to right) which is specified by a binary secret key represented, for its encryption, as an integer: Ks = b1 + b22 + b322 + · · · + b19218 Ks was encrypted using the ElGamal public-key system based on the elliptic curve defined over Fp as: y2 = x3 + x2 + 50x + 251 Known informations about the Elliptic curve are: Modulo: p = 186733 Message key: PB = (64236, 69780) Generator point: P0 = (15, 24353) Alice’s secret key: ASK = [0110101000111011]; Encrypted Secret Key: ek = Ks · Xcom mod p = 83533 Ferro Demetrio, Minetto Alex Page 11 of 19
  • 14. Cryptography Homeworks Problem Statement The stream ciphering system works with two different LFSR schemes: the Fibonacci and Galois ones. A subset of their memory cell’s output is used to generate a stream by non linear combination whose rule is defined by a Non Linear Function (NLF). Such a stream is then used as ciphering key for the Plain Text Message. The two LFSRs are both initialized by the same starting state Ks that Alice sends to Bob by using elliptic curves based ElGamal Encryption system. Bob Channel Alice - Chooses his private key BSK < p - Computes his public key PB → - Retrieves Bob’s public key PB PB = BSK · P0, - Chooses her private key ASK < p - Computes PAB = ASK · PB - Takes only the coordinate Xcom from PAB = (Xcom, Ycom) - Retrieves Alice’s secret key PA ← PA - Encrypts the message by using the and the encrypted key ek ← ek Encryption rule: ek = Ks · Xcom - Computes PBA = BSK · PA = PAB - Takes only the coordinate Xcom from PAB = (Xcom, Ycom) - Decrypts the message inverting the Encryption rule: Ks = ek Xcom mod p The system works with the following known parameters: - Elliptic curve equation: y2 = x3 + x2 + 50x + 251 - Order of the Group Fp of use: p = 186733 - Initial Point: P0 = (15, 24353) As a general convention, the Public Keys PA and PB are not sent over the channel but are retrievable from a shared directory. The security of the system is provided by the elliptic curve’s implementation of ElGamal public key system. If the plain starting state of the LFSRs was sent over the channel, the ciphering stream would be weaker. Implementing Elliptic curves cryptosystem, whatever information sent over the channel is more protected, since its strength requires large primes factorization. Ferro Demetrio, Minetto Alex Page 12 of 19
  • 15. Cryptography Homeworks Elliptic Curves Implementation Starting from the general equation for Elliptic curves over Fp: E(x, y) : y2 + a1xy + a3y = x3 + a2x2 + a4x + a6 (1) We may define the Doubling rule and the Addition rule for points over the elliptic curve. Doubling rule : 2(x1, y1) = (x3, y3) Intercepting the line with equation: (y − y1) = m(x − x1).    y = m(x − x1) + y1 y2 + a1xy + a3y = x3 + a2x2 + a4x + a6 (2) Leads to the following derivation: (m(x − x1) + y1)2 + a1x(m(x − x1) + y1) + a3y = x3 + a2x2 + a4x + a6 m2 (x − x1)2 + y2 1 + 2m(x − x1)y1 + a1x2 m − a1xmx1 + a1xy1 + a3y = x3 + a2x2 + a4x + a6 m2 x2 +m2 x2 1−2m2 xx1+y2 1+2mxy1−2mx1y1+a1x2 m−a1xmx1+a1xy1+a3y = x3 +a2x2 +a4x+a6 x3 −(m2 +a1m−a2)x2 +(2m2 x1−2my1+a1mx1−a1y1+a4)x−(m2 x2 1+y2 1−2mx1y1+a3y−a6) = 0 (3) from Vieta’s formulas, we know that, a Polynomial of degree 3: p(x) = ax3 + bx2 + cx + d, with roots x1, x2, x3 has coefficient b = x1 + x2 + x3. From this, we have: m2 + a1m − a2 = x1 + x2 + x3 (4) The roots of the polynomial in Equation (3) belong to three points on the Elliptic Curve: x1, x2 are the abscissa of the point we are doubling, x3 is the abscissa of the point we are looking for. All we need to know is m, that can be obtained by derivation, since it represents the gradient of the tangent of the line in the point where it intersects the curve: ∂y ∂x = ∂E(x, y)/∂x ∂E(x, y)/∂y = 3x2 + 2a2x + a4 − a1y 2y + a1x + a3 . (5) The actual value of m has to be computed by evaluating the gradient in the point (x1, y1): m = ∂y ∂x x=x1,y=y1 = 3x2 1 + 2a2x1 + a4 − a1y1 2y1 + a1x1 + a3 mod p (6) Ferro Demetrio, Minetto Alex Page 13 of 19
  • 16. Cryptography Homeworks Knowing m, from Equation (4) we may think to solve for x3, y3:    x3 = m2 + a1m − a2 − 2x1 mod p y3 = −(y1 + m(x3 − x1)) mod p (7) We solve the intersection of the line with the equation of the elliptic curve. Addition rule : (x1, y1) + (x2, y2) = (x3, y3) At the same way, it is done by intercepting the line with equation: (y − y1) = m(x − x1). The Derivation (3) is still valid, hence the Equation (4) leads to the computation of x3. This time m is known from the equation of the line crossing two points: m = y2 − y1 x2 − x1 mod p (8) Knowing m, we solve again for x3, y3:    x3 = m2 + a1m − a2 − x1 − x2 mod p y3 = −(y1 + m(x3 − x1)) mod p (9) We solve the intersection of the line with the equation of the elliptic curve. Rules of Interest In our specific case, work over F186733 on the curve of equation: E(x, y) : y2 = x3 + x2 + 50x + 251 (10) That’s what we had before with: a1 = 0, a2 = 1, a3 = 0, a4 = 50, a6 = 251. Doubling: 2(x1, y1) = (x3, y3) Addition: (x1, y1) + (x2, y2) = (x3, y3)    m = 3x2 1 + 2x1 + 50 2y1 mod186733 x3 = m2 − 1 − 2x1 mod186733 y3 = −(y1 + m(x3 − x1)) mod186733    m = y2 − y1 x2 − x1 mod186733 x3 = m2 − 1 − x1 − x2 mod186733 y3 = −(y1 + m(x3 − x1)) mod186733 (11) The encryption key can be found by considering the rules of interest for Alice’s secret key ASK starting from the point Pm. PAB = 15 i=0 2i · ASK(i) · PB = 56406 · PB The computation can be derived in a easier way by applying iteratively the doubling rule, then summing the points. Ferro Demetrio, Minetto Alex Page 14 of 19
  • 17. Cryptography Homeworks x -4 -2 0 2 4 6 y -30 -20 -10 0 10 20 30 y2 = x3 + x2 + 50x + 251 P2 = (x2, y2) P1 = (x1, y1) P3 = (x3, y3) ¯P3 = (x3, −y3) Figure 2: Elliptic Curve Additon Rule 20 · PB = (64236, 69780) 21 · PB = 2 · (64236, 69780) = (48020, 125549) 22 · PB = 2 · (48020, 125549) = (175330, 47928) 23 · PB = 2 · (175330, 47928) = (75937, 71730) 24 · PB = 2 · (75937, 71730) = (72852, 138370) 25 · PB = 2 · (72852, 138370) = (63618, 161) 26 · PB = 2 · (63618, 161) = (56218, 93364) 27 · PB = 2 · (56218, 93364) = (12054, 68385) 28 · PB = 2 · (12054, 68385) = (64182, 46455) 29 · PB = 2 · (64182, 46455) = (50647, 66194) 210 · PB = 2 · (50647, 66194) = (23960, 824) 211 · PB = 2 · (23960, 824) = (78063, 149336) 212 · PB = 2 · (78063, 149336) = (135873, 15725) 213 · PB = 2 · (135873, 15725) = (2026, 123847) 214 · PB = 2 · (2026, 123847) = (15708, 84839) 215 · PB = 2 · (15708, 84839) = (176136, 128991) Ferro Demetrio, Minetto Alex Page 15 of 19
  • 18. Cryptography Homeworks X ×104 0 2 4 6 8 10 12 14 16 18 Y ×104 0 5 10 15 Pcom = (Xcom, Ycom) Figure 3: Set of points obtained by doubling PB represented over F2 p. PAB = (Xcom, Ycom) = 56406 · PB = (2 + 4 + 16 + 64 + 1024 + 2048 + 4096 + 16384 + 32768) · PB = 21 · PB + 22 · PB + 24 · PB + 26 · PB + 210 · PB +211 · PB + 212 · PB + 214 · PB + 215 · PB = (27910, 6518) Once found the value assumed by Xcom = 27910, we could retrieve the initial state for the LFSR Ks, by inverting its relationship with ek. Ks = ek Xcom mod p = 116211, Finding the inverse of Xcom in modp was made by solving Diophantine equations. To solve the equation: Xcom · X−1 com = 1 mod p We just considered that Xcom and p are relatively prime: gcd(Xcom, p) = 1, They satisfy B´ezout’s identity: uXcom + vp = 1 where u, v ∈ Fp can be easily computed. Since the operations are over Fp, the previous equation becomes: u · Xcom = 1 mod p, hence the value u that we find using gcd is equal to X−1 com = u. Ferro Demetrio, Minetto Alex Page 16 of 19
  • 19. Cryptography Homeworks LFSR Implementation Once we have found the starting state Ks = 116211 in decimal form by decrypting Alice’s secret message ek, we need to read it in binary form in order to use it as starting state for LFSRs, padding it to fit the size of the whole registers. Ks = (116211)2 = b1 + b2 · 2 + b3 · 22 + · · · + b19 · 218 + · · · b23 · 222 ; ¯x(0) = {bi}23 i=1 = [ 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ]T ; ¯y(0) = {bi}23 i=1 = [ 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ]T ; We implemented LFSRs shift by using matrices represent1ation: AF =               0 1 0 0 · · · 0 0 0 1 0 · · · 0 0 0 0 1 · · · 0 0 0 0 0 · · · 0 0 0 0 0 · · · 0 ... ... ... ... ... ... am am−1 am−2 am−3 · · · a1               AG =               0 0 0 0 · · · am 1 0 0 0 · · · am−1 0 1 0 0 · · · am−2 0 0 1 0 · · · am−3 0 0 0 1 · · · am−4 ... ... ... ... ... ... 0 0 0 0 · · · a1               By doing the following operation, we get iteratively the state update ¯x(n) for each state transition n so that we generate a stream of length N which is the size of the encrypted message in binary form. ¯x(n) = AF · ¯x(n − 1) ¯y(n) = AG · ¯y(n − 1) Once we have generated the output streams: ¯x(n), ¯y(n), ∀n = 0, · · · , N − 1, we have applied the NLF function by by combining a subset of elements of each stream by the following rule: NLF(¯x(n), ¯y(n)) = x2(n) · x10(n) · y7(n) · y16(n) + x1(n) · x5(n) + y1(n) · x7(n) + y23(n); At the end, Bob can finally obtain the plaintext binary stream in order to read the Plain Text Message as shown in Figure . E(n) = NLF(n) ⊕ M(n) is inverted easily by doing: M(n) = NLF(n) ⊕ E(n) Since a simple 5 bits binary coding rule is applied to the plain text in character form, Bob has to read blocks of 5 bits and decode them using the relative mapping table. Ferro Demetrio, Minetto Alex Page 17 of 19
  • 20. Cryptography Homeworks LFSR1 LFSR2 ... LFSRn FSM NLF ⊕ M(n) E(n) ECC(K) LFSR1 LFSR2 ... LFSRn FSM NLF⊕ Alice Channel Bob Figure 4: Stream Ciphering with Key encryption basic model LFSR1 (Fibonacci) LFSR2 (Galois) NLF(n) x1 a23 x2 a22 x3 a21 x4 a20 x5 a19 x6 a18 x7 a17 x8 a16 x9 a15 x10 a14 x11 a13 x12 a12 x13 a11 x14 a10 x15 a9 x16 a8 x17 a7 x18 a6 x19 a5 x20 a4 x21 a3 x22 a2 x23 a1 ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ y1 a23 y2 a22 y3 a21 y4 a20 y5 a19 y6 a18 y7 a17 y8 a16 y9 a15 y16 a8 y23 a1 ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ · · · · · · ⊕ NLF(n) = x2(n) · x10(n) · y7(n) · y16(n) + x1(n) · x5(n) + y1(n) · x7(n) + y23(n) Figure 5: NLF Fibonacci, LFSR Galois and NLF visualization. Ferro Demetrio, Minetto Alex Page 18 of 19
  • 21. Cryptography Homeworks Results The Output of the NLF function is the following: 0 1 0 0 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 0 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 1 0 0 0 0 1 0 1 1 1 1 1 0 0 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 The final output of the decryption is: “true education makes for inequality: the inequality of individuality, the inequality of success, the glorious inequality of talent, of genius. felix e. schelling american educator.” Ferro Demetrio, Minetto Alex Page 19 of 19