You are on page 1of 18

Name : Gusti Arsyad

Matric Number : M031910058


Course : MITZ (Security Science)
Faculty : FTMK
Title Project 2 : Hybrid AES-GCM and NTRU for Email
Supervisor : Prof. Rabiah Ahmad

Universiti Teknikal Malaysia Melaka


Faculty of Information and Communication Technology
WEB PROJECT 2 HYBRID CRYPTOGRAPHY AES-GCM & NTRU FOR EMAIL

Python
TABLE OF CONTENTS
About the Project 01 Major Requirements 02
The Hybrid AES-GCM and NTRU Cryptography Project was created using The hybrid encryption scheme consists of two parts:
Python in the Django framework, where the symmetric cryptography, namely 1.Symetric key encryption called DEM (Data Encapsulation Mechanism),
the AES-GCM algorithm is taken from the Pyhton Crypto library, AES 2. Public key encryption called KEM (Key Encapsulation Mechanism).
Cipher, and pyscrypt, while for asymmetric cryptography the NTRU 3. In project 2, a symmetrical algorithm is used, namely AES-GCM and the NTRU
algorithm is documented by Github MIT License Copyright (c ) 2018 Jędrzej asymmetric algorithm.
Krauze.

Project Goals 03
1. Test AES-GCM encryption and decryption time
2. Measure the NTRU encryption and decryption time
3. Combining both AES-GCM and NTRU algorithms and then measured the
encryption and decryption times
4. Check data security with tools such as Wireshark

04 Project Stages
1. Demo project 2
2 Discussion and analysis
3. Conclusion
PROJECT STAGES
STEP 2
Analysis and Discussion

STEP 1
Demo program
STEP 3
Conclusion
1. Demo Program
Schema of Hybrid AES-GCM and NTRU for Email Messages

Ciphertext 1
Message Alice Message
Bob

AES-GCM Algorithm
Private Key AES Private Key AES

NTRU Algorithm
Ciphertext 1
Public Key NTRU Private Key NTRU

Ciphertext 2 Ciphertext 2

Sender Receiver
2. Analysis and Discussion
Table Encryption of AES-GCM
No. Plaintext Key Ciphertext (hex) Algorithm
AES-GCM
(s)
1. This is message 1 123456cobao 933387e2064910f323e934b04dec335cb8 2.86
ke123#
2. This is message 2 from Gusti 123456cobaoke f6028138b903652c0da6ae186dc5a06233285249227 2.86
123#Oke f68f1bfd20e04
3. This is message 3 from Gusti, 12Oke 6017eba8c653976e0d93c3a43da1f235e33c6ce0743 3.09
Abdul and Indra 5e430f4d2b87e62e9a5dcdda5465e70f7889c0c3ed6
5540
4. This is message 4 from Gusti, 123Okeco8a d25de949e31ff35ff9063a2327a0d247023733072fa7f 3.57
Abdul and Indra to Riza also 527279906d8fda41970a7bb889d394ed4a2c5534efb
Deti 52e7ad1373b3ed6ace5ac8d12d9034b99e5cfd
5. This is message 4 from Gusti, 123Okeco8a12 1ade3ca0d501be4d7a0b11ca0866ae55e8c15dce42 2.86
Abdul and Indra to Riza also 3tes 2bfa823fe8fbe5aaa31d00c65c381662f11a780e0393
Deti. so welcome to hybrid 127af487199021a443ee6ac24a327f9447c4fac12622
aesntru 5942c4ddf0e54c0137709c255a1ac8ec0e60fcc6dcd8
646d674886fc
Avarage 15.24
Table Generate NTRU

No. Generate Key (s) Average (s)

Key 1 Key 2 Key 3 Key 4 Key 5


1. key.priv.npz key.pub.npz 6,908 6,893 7,023 6,977 6,921 34.722
Table Encryption of NTRU
No. Plaintext Key Ciphertext Algorithm NTRU
Key AES
Real User Sys
(s) (s) (s)
1. 123456co key.pub. 5c41325c39415c45425c43343f5c44447f45c44304f017a5c43457d30154671495c38455c45 1,030 1,14 0,22
baoke123 npz 315c46305c46345c38365c4437428435c44425e5c42395c4533287f5c39417f175c39465e5
# c464106135c41372e4e4d514b465c38355c433677315c41325e5c44395e5c41390c4d5c38
320c5c41355c4443651a5c38416e5c46465c46304b705c39335c46445c3845581c5c44422c
445c4644452736138075c46425c42385c3841015c4346135c44315c46321f5c4245665c433
25c3030545c43445c45451a5e5c42375c453951185c4135164b5c42385c38305c44366b5c4
6465d5c45371d205c3030425c4441395c42375c384232105c45363026712d5c38417b5c41
30240222365c3839305c46397d5c42345c3030
2. 123456co key.pub. 3b225c4633145b25f5c39455c46371e395c46325c3930744b4a5c42445c39305f5c4636601 1,219 1,193 0,312
baoke123 npz 67752d5c46455c393119085c42313f5c393825155c4645435c44397b651c535c39335c4341
#Oke 6755c4138475e5c39425c38395c43365b20c1b0a5c383257255c3845295c43395c4336245
c4232655c46305c4132335c4443251d5c42391a6b45195c38465c38352c5c3942625c4545
175c44345c4433675c39431e5c41465c453653505c393356b265c46375c46415c38345c43
3171125c44396f5c39363c5c4242515c4245720f5c39460a5c4335045c41335c45300a5c463
45c42343c5c38352d5c4141215c3835285c43375b5c4138265c41465c4444100373315c39
375c39330b5c44325c46385c44445c45325c46415c3030
3. 12Oke key.pub. 5c45305c39376d5c42314b5c41335c42396b5c41311d5c38327e95c42425c41427 1,022 1,088 0,286
npz 15c41395c424473485f6d5c3941365c46335c46335d15c43395c30305c42415c463
05c46435c39315c42447e5c44445c46345c4145126035c4438515c3933445c3846
7a5c41323c3815635c434113055c46395c42337d7650195c42335c46355c443950
5c4533085c39333e5c41416c295c44381c5c41305c4346465c424628a5c41425c44
4466396662376e065c39465c41365c44395c46425c46385c4130020a6f5c38365c3
9435c4434695c3830135e5c46325c39415c45357b2d5c46415c43355c45415c454
65c4232147f5c38335c41305c3834025c43305c38455c4438164d0e5c46445c3841
055c463316785c45425c43305c42345c41375c41375c39455c444333105c45465c
42315c44315c3030
Table Encryption of NTRU
No. Plainte Key Ciphertext Algorithm NTRU
xt Key
AES Real User Sys
(s) (s) (s)

4 123Ok key.pub. 5c4337105c41352b27538355c45305c39435c42364e5c39454126345c42335d605c30300b5c41 1,002 1,070 0,256


eco8a npz 46223f5c413935524a5c413840760c5c38366b1542165c44305c43315c43385c4342105c41317
569645c39365c45455c43415c4533545c43343e5c42435c42416f11395c4342643a5c38345c464
35c42415c4138275c4133c18a5c44351d565c46422c525f5c45425b065c44355c46365c4530062
17c535432695c42395c45415c44315c4333f9365c44427a5c4137200b1d2d6e68537d1d20507a
505c38425c38355c41362a5c4535535c44347375c41301e2478214b5c45456737595c46315c38
315c43315c44305c45375c46385c4237675c43356022245c46445c3830

5. 123Ok key.pub. 05115c44303a122e5c43317426305c4442535c43447d1f035c38375c39426672745c42355c424 1,005 1,120 0,232


eco8a1 npz 145441d5c45343a105c45437e5c3943505c38351f5fe2542c5c44385c4645445c44435c43335f5c
23tes 38385c434448261879710a5c38325e135c3943441d5c43424557095c42385c46315c4231555c4
6345c43443564e15c41335c38465c38355c42425c38345c41305c413965455c39463404145c43
363955c4439556705c38466c305c4537235c41376d305c45465c4637045c45315c44435c45465
33c5c42445c45415c4433025d385c463623325c41375c4235635d5c41385c38335c443873745f5
c434235592f5c41466e305c41333b5c42465c4539324e6c041e5c3030

Average 5.278
Table Decryption of NTRU
No. Ciphertext Key Plaintext Algorithm NTRU
Key AES
Real User Sys
(s) (s) (s)

1. 5c41325c39415c45425c43343f5c44447f45c44304f017a5c43457d30154671495c38455 key.priv. 123456coba 1,237 1,276 0,312


c45315c46305c46345c38365c4437428435c44425e5c42395c4533287f5c39417f175c39 npz oke123#
465e5c464106135c41372e4e4d514b465c38355c433677315c41325e5c44395e5c4139
0c4d5c38320c5c41355c4443651a5c38416e5c46465c46304b705c39335c46445c38455
81c5c44422c445c4644452736138075c46425c42385c3841015c4346135c44315c46321
f5c4245665c43325c3030545c43445c45451a5e5c42375c453951185c4135164b5c4238
5c38305c44366b5c46465d5c45371d205c3030425c4441395c42375c384232105c4536
3026712d5c38417b5c4130240222365c3839305c46397d5c42345c3030

2. 3b225c4633145b25f5c39455c46371e395c46325c3930744b4a5c42445c39305f5c4636 key.priv. 123456cobao 1,400 1,513 0,181


60167752d5c46455c393119085c42313f5c393825155c4645435c44397b651c535c3933 npz ke123#Oke
5c43416755c4138475e5c39425c38395c43365b20c1b0a5c383257255c3845295c4339
5c4336245c4232655c46305c4132335c4443251d5c42391a6b45195c38465c38352c5c3
942625c4545175c44345c4433675c39431e5c41465c453653505c393356b265c46375c
46415c38345c433171125c44396f5c39363c5c4242515c4245720f5c39460a5c4335045c
41335c45300a5c46345c42343c5c38352d5c4141215c3835285c43375b5c4138265c414
65c4444100373315c39375c39330b5c44325c46385c44445c45325c46415c3030

3. 5c45305c39376d5c42314b5c41335c42396b5c41311d5c38327e95c42425c4142715c41 key.priv. 12Oke 1,252 1,376 0,233


395c424473485f6d5c3941365c46335c46335d15c43395c30305c42415c46305c46435c npz
39315c42447e5c44445c46345c4145126035c4438515c3933445c38467a5c41323c381
5635c434113055c46395c42337d7650195c42335c46355c4439505c4533085c39333e5c
41416c295c44381c5c41305c4346465c424628a5c41425c444466396662376e065c394
65c41365c44395c46425c46385c4130020a6f5c38365c39435c4434695c3830135e5c46
325c39415c45357b2d5c46415c43355c45415c45465c4232147f5c38335c41305c38340
25c43305c38455c4438164d0e5c46445c3841055c463316785c45425c43305c42345c41
375c41375c39455c444333105c45465c42315c44315c3030
Table Decryption of NTRU
No. Ciphertext Key Plaintext Algorithm NTRU
Key AES
Real User Sys
(s) (s) (s)
4. 5c4337105c41352b27538355c45305c39435c42364e5c39454126345c42335d605c30300b5 key.priv 123Okeco 1,237 1,337 0,240
c4146223f5c413935524a5c413840760c5c38366b1542165c44305c43315c43385c4342105 .npz 8a
c41317569645c39365c45455c43415c4533545c43343e5c42435c42416f11395c4342643a5
c38345c46435c42415c4138275c4133c18a5c44351d565c46422c525f5c45425b065c44355
c46365c453006217c535432695c42395c45415c44315c4333f9365c44427a5c4137200b1d2
d6e68537d1d20507a505c38425c38355c41362a5c4535535c44347375c41301e2478214b5c
45456737595c46315c38315c43315c44305c45375c46385c4237675c43356022245c46445c
3830
5. 05115c44303a122e5c43317426305c4442535c43447d1f035c38375c39426672745c42355c key.priv 123Okeco 1,265 1,370 0,244
424145441d5c45343a105c45437e5c3943505c38351f5fe2542c5c44385c4645445c44435c4 .npz 8a123tes
3335f5c38385c434448261879710a5c38325e135c3943441d5c43424557095c42385c46315
c4231555c46345c43443564e15c41335c38465c38355c42425c38345c41305c413965455c3
9463404145c43363955c4439556705c38466c305c4537235c41376d305c45465c4637045c4
5315c44435c4546533c5c42445c45415c4433025d385c463623325c41375c4235635d5c413
85c38335c443873745f5c434235592f5c41466e305c41333b5c42465c4539324e6c041e5c30
30
Average 6.391
Table Decryption of AES-GCM
No. Ciphertext (hex) Key Plaintext Algorithm
AES-GCM
(s)
1. 933387e2064910f323e934b04dec335cb8 123456cobaoke123# This is message 1 2.38

2. f6028138b903652c0da6ae186dc5a06233285249227f68f1bf 123456cobaoke123#Ok This is message 2 from 2.14


d20e04 e Gusti

3. 6017eba8c653976e0d93c3a43da1f235e33c6ce07435e430f4 12Oke This is message 3 from 2.62


d2b87e62e9a5dcdda5465e70f7889c0c3ed65540 Gusti, Abdul and Indra

4. d25de949e31ff35ff9063a2327a0d247023733072fa7f527279 123Okeco8a This is message 4 from 2.38


906d8fda41970a7bb889d394ed4a2c5534efb52e7ad1373b3 Gusti, Abdul and Indra to
ed6ace5ac8d12d9034b99e5cfd Riza also Deti

5. 1ade3ca0d501be4d7a0b11ca0866ae55e8c15dce422bfa823f 123Okeco8a123tes This is message 4 from 2.14


e8fbe5aaa31d00c65c381662f11a780e0393127af487199021 Gusti, Abdul and Indra to
a443ee6ac24a327f9447c4fac126225942c4ddf0e54c013770 Riza also Deti. so
9c255a1ac8ec0e60fcc6dcd8646d674886fc welcome to hybrid
aesntru

Average 11.66
Table Decryption of AES-GCM
No. Ciphertext (hex) Key Plaintext Algorithm
AES-GCM
(s)
1. 933387e2064910f323e934b04dec335cb8 123456cobaoke123# This is message 1 2.38

2. f6028138b903652c0da6ae186dc5a06233285249227f68f1bf 123456cobaoke123#Ok This is message 2 from 2.14


d20e04 e Gusti

3. 6017eba8c653976e0d93c3a43da1f235e33c6ce07435e430f4 12Oke This is message 3 from 2.62


d2b87e62e9a5dcdda5465e70f7889c0c3ed65540 Gusti, Abdul and Indra

4. d25de949e31ff35ff9063a2327a0d247023733072fa7f527279 123Okeco8a This is message 4 from 2.38


906d8fda41970a7bb889d394ed4a2c5534efb52e7ad1373b3 Gusti, Abdul and Indra to
ed6ace5ac8d12d9034b99e5cfd Riza also Deti

5. 1ade3ca0d501be4d7a0b11ca0866ae55e8c15dce422bfa823f 123Okeco8a123tes This is message 4 from 2.14


e8fbe5aaa31d00c65c381662f11a780e0393127af487199021 Gusti, Abdul and Indra to
a443ee6ac24a327f9447c4fac126225942c4ddf0e54c013770 Riza also Deti. so
9c255a1ac8ec0e60fcc6dcd8646d674886fc welcome to hybrid
aesntru

Average 11.66
Encryption hybrid Hybrid AES-GCM and NTRU
Encrypt Encrypt Encryption
NTRU (s) AES (s) Hybrid AES-
NTRU (s) Decryption hybrid
1.03 2.86 3.89 Decrypt Decrypt Decryption
1.219 2.86 4.079 NTRU (s) AES (s) Hybrid AES-
NTRU (s)
1.022 3.09 4.112
1.237 2.38 3.617
1.002 3.57 4.572
1.4 2.14 3.54
1.005 2.86 3.865
1.252 2.62 3.872
Average 20.518
1.237 2.38 3.617
1.265 2.14 3.405
Average 18.051
3. Conclusion
References
1). Kurosawa, K ”Hybrid Encryptio”, DOI: https://doi.org/10.1007/978-1-4419-5906-5_321
2). NTRU https://github.com/jkrauze/ntru
3). AES https://pycryptodome.readthedocs.io/en/latest/src/cipher/cipher.html
4). Template PPT Web Project Proposal by Slidesgo https://slidesgo.com/theme/web-project-proposal
THANKS!

m031910058@student.utem.edu.my

You might also like