SlideShare a Scribd company logo
1 of 9
Download to read offline
Digital Certified Mail
Group 9
Baek Soo Kwak
Department of Computer
Engineering
San Jose State University
baeksoo.kwak@sjsu.edu
Ikwhan Chang
Department of Computer
Engineering
San Jose State University
Ikwhan.chang@sjsu.edu
ABSTRACT
We investigated on digital certified mail
system and pretty good privacy protocol
which is applied to the email security. Both
email securing methodologies are implemented
by NodeJS and deployed the basic mechanism
to exchange the messages. Key security parts
of digital certified mail are by using the
oblivious transfer protocol which does not
necessarily specify selection of keys and
messages. Furthermore, PGP applied to email
system was studied to be compared with the
digital certified mail.
KEYWORDS
RSA, AES, Asymmetric, Oblivious Transfer
Protocol, Digital Certified Mail, Pretty
Good Privacy
1 INTRODUCTION
Today email is the most used media in
exchanging messages and information between
people and groups. However, there are not
many known efficient ways of securing the
email system, since it is also one of the
challenging parts due to trade-off among
performance and security. In this project,
we have done research on the digitally
certified mail up to implementing the base
algorithm and then, went through more on
pretty good privacy (PGP) applied to the
email system.
2 BACKGROUND
Digital certified mail is one of the
suggested methods before, and it was
invented in a few decades ago so, it would
not be fully utilizing now. This is using a
base protocol called oblivious transfer
protocol, and the story should be started
from the situation where signing contract
over the network.
The best way must be a physical solution
where two parties are sitting together to
sign the contracts at the same time, and
then exchange the signed documents in that
place. However, the scenario needs to be
modified when it is happening over the
network. In general, fair exchange of keys
and messages between sender and receiver are
desired, but probably fail all or success
all.
The base of digitally certified mail system
is from oblivious transfer protocol, and we
tried to implement this algorithm by using
NodeJS.
3 OBLIVIOUS TRANSFER PROTOCOL
Oblivious Transfer Protocol has a
mechanism that a receiver wants to have a
specific message from a sender without
notifying the selection to the sender, and
the sender transmits all encrypted messages
based on the protocol oblivious to what
receiver get as she/he want. The key
security characteristic comes from the facts
that the receiver and sender do not need to
specify selection and keys, but they can do
exchange what they want to transfer.
Here is the description of basic 1-2
Oblivious Transfer Protocol to go for
digitally certified mail system.
Figure 1: The basic steps of oblivious
transfer protocol
Digital Certified Mail Group 9
2
Above table shows the steps for 1-2
oblivious transfer protocol that the sender
has two messages m0 and m1, and the receiver
has a selection bit b. Here the receiver
wants to receive mb, without the sender
knowing b, while the sender wants to make
sure that the receiver receives only one of
the two messages. The protocol can be
instantiated using RSA encryption.
4 PRETTY GOOD PRIVACY
PGP is a popular program used to encrypt and
decrypt Internet e-mail. It can also be used
to send an encrypted digital signature that
identifies the identity of the sender so
that it can be assured that the message has
not changed in transit. PGP is a freeware,
low-cost commercial version, and is the most
widely used confidentiality program by
individuals and businesses. This program was
developed by Philip R. Zimmermann in 1991
and became the de facto standard in e-mail
security. PGP can also be used to encrypt
and store files so that they cannot be read
by other users or intruders.
4.1 How it works
PGP uses a variant of the public key system.
In a public-key system, each user has a
publicly known cryptographic key and only a
private key known only to that user. The
user encrypts the message he or she wants to
send using the recipient's public key. When
the recipient receives it, they decrypt it
with their private key. Because encrypting
the entire message can take time, PGP uses a
faster encryption algorithm to encrypt the
message and then uses the public key to
encrypt the short key that was used to
encrypt the entire message. Both the
encrypted message and the short key are sent
to the recipient who first uses his private
key to decrypt the short key and then uses
the short key to decrypt the entire message.
PGP comes in two public-key versions: RSA
and Diffie-Hellman. In the RSA version, the
IDEA algorithm is used to generate the short
key used to encrypt the entire message, and
RSA is used to encrypt the short key. The
Diffie-Hellman version uses the CAST
algorithm for short keys to encrypt the
entire message and uses the Diffie-Hellman
algorithm to encrypt the short keys.
To send a digital signature, PGP uses an
efficient algorithm to generate a hash code
from the user's name and other signature
information. This hash code is encrypted
with the sender's private key. The recipient
uses the sender's public key to decrypt the
hash code. If it matches a hash code sent as
an electronic signature for the message, the
recipient can be assured that the message
arrived safely from the sender who signed
it. The RSA version of PGP uses the MD5
algorithm to generate hash codes. The
Diffie-Hellman version of PGP uses the SHA-1
algorithm to generate hash codes.
To use PGP, you must download it or purchase
it and install it on your computer system.
In general, it includes a user interface
that works with your favorite e-mail
program. Users need to register their public
key with their PGP public key server so that
people who will exchange messages with them
will be able to find their public keys.
Network Associates maintains an LDAP / HTTP
public key server with 300,000 registered
public keys. This server is mirrored to
other sites around the world.
4.2 Where can I use PGP?
Originally, the US government limited the
export of PGP technology.
However, PGP-encrypted e-mail today can also
be exchanged with users outside the United
States if they have the correct version of
PGP on both sides. The international version
of PGP is as secure as the national version
used in the US, unlike most other encryption
products.
It is illegal to use freely available PGP
freeware for commercial purposes, in which
case you must purchase a commercial version
from Network Associates (formerly PGP,
Inc.). There are several versions of PGP
currently in use. Additional programs are
available to keep the new RSA version
compatible with previous versions. However,
PGP's Diffie-Hellman and RSA versions do not
work together because they use different
algorithms. This term was originally written
by Sabrina Dei Giudici of Web Marketing,
based in Western Australia.
William Stallings's paper "Getting Cryptic -
PGP or You and Me" is a great resource.
PGP's homepage is now at Network Associates.
Digital Certified Mail
San Jose State University, CMPE 209 Project,
Group 9
3
For more information about PGP, or to
download the latest version, please visit
International PGP Page.
5 IMPLEMENTATION
5.1. SW Specification
- Backend/Frontend: Node.js v7.7.4
- Language: JavaScript
- DBMS: Mongo DB v3.4.4
- Public Repository:
https://github.com/IkwhanChang/certified-
mail
5.2. How to run
1) Copy the source code: git clone
https://github.com/IkwhanChang/certified-
mail
2) Install the dependencies: npm install
3) Install MongoDB by using instruction
manual:
https://docs.mongodb.com/manual/installation
/
4) Run the MongoDB: sudo mongod and create
the database of “Mail”
5) Run the server: node receiver.js
6) Connect the GUI: http://localhost:5001
7) Compose any email and see the console
output
5.3 SW Architecture
Figure 2. Software Architecture
In our project, we used node.js and
express.js To use the RSA algorithm; we use
the node-rsa
(https://github.com/rzcoder/node-rsa)
5.4 User Interface
We have three GUI user interface: 1) Inbox:
to see every email that received from the
start 2) Compose: to compose the email with
WYSIWYG text editor 3) View: to see specific
email
Figure 3. Inbox
Figure 4. Compose Email
Figure 5. View Mail
5.5 Algorithms and Code
- Step 1 – Alice send the N, e, x1, x2
Table 1. Step 1
Digital Certified Mail Group 9
4
In this logic, Alice will create the RSA key
pair and send the public portion (N, e) and
two random messages generated by Alice to
the Bob. Thus, Bob will receive (N, e) and
x0 and x1
Related Source Code
function alice_1(msg) {
console.log("nn============= ALICE STEP
#1 ================");
console.log("============= MSG :
"+msg.trim() + "================");
m0 = a2hex(msg.trim().split(' ')[0]);
m1 = a2hex(msg.trim().split(' ')[1]);
console.log("");
console.log("m0 : "+m0);
console.log("m1 : "+m1);
var key = new NodeRSA({b: 16});
var bit = 2048;
var exp = 65537;
console.log("");
console.log("Bit: "+ bit);
console.log("Exp: "+ exp);
key.generateKeyPair(bit, exp);
console.log("");
console.log("=> PUBLIC/PRIVATE KEY");
console.log(key.exportKey('pkcs1'));
console.log(key.exportKey('components'));
private_D =key.exportKey('components').d;
public_N = key.exportKey('components').n;
public_E = key.exportKey('components').e;
// Alice's public N, e => Bob
console.log("");
console.log("[TRANSFER] Alice's public N,
e => Bob");
return
bob_1(key.exportKey('components').n,
key.exportKey('components').e);
}
In above code, the message will be split by
space (e.g. original message: Hello World,
split message: Hello / World) Then, we will
convert that message from ASCII to Hex for
calculating. Afterward, RSA key pair will be
generated by using the node-RSA library and
the definition of bit and exponent (in this
example, 65537 of the exponent) Finally,
Alice is ready to send the public key pairs.
Figure 6. Console result of step 1
- Step 2: Bob select b and either x0 or x1,
generate v and send v to the Alice
Table 2. Step 2
In this step, first Bob need to select
either x0 or x1 that received from Alice.
Once Bob select, the selected xb will be
used for creating the v by using equation of
v = (xb + k^e) mod N. Finally, the N will be
sent to the Alice.
Related Source Code
function bob_1(public_N, public_E){
console.log("nn============= BOB STEP #1
================");
console.log("[RECEIVED] public_N:
"+public_N.readInt32BE());
console.log("[RECEIVED] public_E':
"+public_E);
//var private_D
=key.exportKey('components').d;
// BOB
//var public_N =
key.exportKey('components').n;
//var public_E =
key.exportKey('components').e;
var x0 = makeid();
var x1 = makeid();
console.log("nx0: "+ x0);
console.log("x1: "+ x1);
Digital Certified Mail
San Jose State University, CMPE 209 Project,
Group 9
5
var xb;
var b = Math.random() < 0.5 ? 1 : 0;
console.log("nChoose b in {0,1}: "+ b);
if(b === 0){
xb = x0;
console.log("Xb: x0");
}else{
xb = x1;
console.log("Xb: x1");
}
var k = 1;//Math.floor(Math.random() *
20)/100;
//console.log(parseInt(xb, 16));
var v = (parseInt(xb, 16) +
math.mod(Math.pow(k, public_E),
public_N.readInt32BE()));
console.log("nv: "+v);
console.log("n[TRANSFER] Bob's v, x0, x1
=> Alice");
return alice_2(v, x0, x1);
}
In the above code, we used static k of 1
because since we have a large number of the
exponent (in this example 65531), it took a
long time to calculate the v . Plus, we used
the HEX to calculate every key since we have
a large number of the original message.
Figure 7. Console result of step 2
- Step 3: Alice generate k0 and k1, send
them to the Bob, and get the original split
message
Table 3. Step 3
In this final step, Alice will create k0 and
k1 by using the v that received in the
previous step. Once Alice calculates k0 and
k1, then m'0 and m'1 can be created. Then,
Alice sends those extra messages to the Bob.
Once Bob received the k0 and k1, Bob can
simply compare with k that he randomly
selected in the previous step. If either m'0
or m'1 is null or infinity number, then we
can simply know which m is the original
message. Finally, Bob can know the original
split message.
Related Source Code
function alice_2(v, x0, x1) {
console.log("nn============= ALICE STEP
#2 ================");
console.log("[RECEIVED] v: "+v);
console.log("[RECEIVED] x0': "+x0);
console.log("[RECEIVED] x1': "+x1);
// ALICE
//var public_N =
key.exportKey('components').n;
var k0 = Math.pow((v - parseInt(x0, 16)),
private_D.readInt32BE());
var k1 = Math.pow((v - parseInt(x1, 16)),
private_D.readInt32BE());
console.log("nprivate_D
"+private_D.readInt32BE());
console.log("k0: "+k0);
console.log("k1: "+k1);
var m0_ = parseInt(m0, 16) + parseInt(k0,
16);
var m1_ = parseInt(m1,16) + parseInt(k1,
16);
console.log(" nm0': "+m0_);
console.log("m1': "+m1_);
//console.log(m0_);
//console.log((m1_ - parseInt(k1,
16)).toString(16));
console.log("n[TRANSFER] Alice's created
m0', m1' => Bob");
Digital Certified Mail Group 9
6
return bob_2(m0_, m1_, k0, k1);
}
function bob_2(m0_, m1_, k0, k1){
console.log("nn============= ALICE STEP
#2 ================");
console.log("[RECEIVED] m0': "+m0_);
console.log("[RECEIVED] m1': "+m1_);
var mb;
//console.log(mb);
if(isNaN(m0_)){
mb = (m1_ - parseInt(k1,
16)).toString(16);
}else{
mb = (m0_ - parseInt(k0,
16)).toString(16);
}
console.log("nmb: "+m1_);
console.log("nmb.toString() (Bob's
decrypted message) : "+hex2a(mb));
//console.log(hex2a(mb));
return hex2a(mb);
}
The final result is hex2a(mb) (hex2a() is
convert from hex to ASCII)
Figure 8. Console result of step 3
Appendix A. Full Source Code
Frontend
Script.js
$(document).ready(function(){
'use strict';
$("#btn_send").click(function(e){
//alert($("#email-editor").html());
//alert($("#email-editor").code());
$.get("/send", {
subject: $("#subject").val(),
text: $("#email-editor").code()
}, function(response){
location.href = '/';
});
e.preventDefault();
});
$.get("/getAll", function(response){
console.log(response);
$.each(response, function(key, value){
$(".email-list").append('<div
class="item"
onclick="location.href='/view/'+value._id+'
'"><div><div class="am-checkbox"><input
id="check3" type="checkbox"><label
for="check3"></label></div></div><div><span
class="date pull-right"><i class="icon s7-
paperclip"></i>'+value.published_date.substr
ing(0,10)+'</span><h4 class="from">Alice
Lee</h4><p
class="msg">'+value.subject+'</p></div></div
>');
});
});
});
Backend
Server.js
var express = require('express');
var app = express();
var mongoose = require('mongoose');
var NodeRSA = require('node-rsa');
// DEFINE MODEL
var Mail = require('./mail');
var math = require('mathjs');
// CONNECT TO MONGODB SERVER
var db = mongoose.connection;
db.on('error', console.error);
db.once('open', function(){
// CONNECTED TO MONGODB SERVER
Digital Certified Mail
San Jose State University, CMPE 209 Project,
Group 9
7
console.log("Connected to mongod
server");
});
mongoose.connect('mongodb://localhost/Mail')
;
app.set('port', (process.env.PORT || 5001));
app.use(express.static(__dirname +
'/public'));
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
response.render('pages/inbox');
});
app.get('/compose', function(request,
response) {
response.render('pages/compose');
});
app.get('/view/:id', function(request,
response) {
Mail.findOne({_id: request.params.id},
function(err, email){
if(err) return
res.status(500).send({error: 'database
failure'});
console.log(email.subject);
response.render('pages/view',
{subject: email.subject, text: email.text});
//response.json(mails);
})
});
app.get('/getAll', function(request,
response) {
Mail.find(function(err, mails){
if(err) return
res.status(500).send({error: 'database
failure'});
response.json(mails);
})
});
var private_D, public_N, public_e;
var m0, m1;
function alice_1(msg) {
console.log("nn============= ALICE STEP
#1 ================");
console.log("============= MSG :
"+msg.trim() + "================");
m0 = a2hex(msg.trim().split(' ')[0]);
m1 = a2hex(msg.trim().split(' ')[1]);
console.log("");
console.log("m0 : "+m0);
console.log("m1 : "+m1);
var key = new NodeRSA({b: 16});
var bit = 2048;
var exp = 65537;
console.log("");
console.log("Bit: "+ bit);
console.log("Exp: "+ exp);
key.generateKeyPair(bit, exp);
console.log("");
console.log("=> PUBLIC/PRIVATE KEY");
console.log(key.exportKey('pkcs1'));
console.log(key.exportKey('components'));
private_D =key.exportKey('components').d;
public_N = key.exportKey('components').n;
public_E = key.exportKey('components').e;
// Alice's public N, e => Bob
console.log("");
console.log("[TRANSFER] Alice's public N,
e => Bob");
return
bob_1(key.exportKey('components').n,
key.exportKey('components').e);
}
function bob_1(public_N, public_E){
console.log("nn============= BOB STEP #1
================");
console.log("[RECEIVED] public_N:
"+public_N.readInt32BE());
console.log("[RECEIVED] public_E':
"+public_E);
//var private_D
=key.exportKey('components').d;
// BOB
//var public_N =
key.exportKey('components').n;
//var public_E =
key.exportKey('components').e;
var x0 = makeid();
var x1 = makeid();
console.log("nx0: "+ x0);
Digital Certified Mail Group 9
8
console.log("x1: "+ x1);
var xb;
var b = Math.random() < 0.5 ? 1 : 0;
console.log("nChoose b in {0,1}: "+ b);
if(b === 0){
xb = x0;
console.log("Xb: x0");
}else{
xb = x1;
console.log("Xb: x1");
}
var k = 1;//Math.floor(Math.random() *
20)/100;
//console.log(parseInt(xb, 16));
var v = (parseInt(xb, 16) +
math.mod(Math.pow(k, public_E),
public_N.readInt32BE()));
console.log("nv: "+v);
console.log("n[TRANSFER] Bob's v, x0, x1
=> Alice");
return alice_2(v, x0, x1);
}
function alice_2(v, x0, x1) {
console.log("nn============= ALICE STEP
#2 ================");
console.log("[RECEIVED] v: "+v);
console.log("[RECEIVED] x0': "+x0);
console.log("[RECEIVED] x1': "+x1);
// ALICE
//var public_N =
key.exportKey('components').n;
var k0 = Math.pow((v - parseInt(x0, 16)),
private_D.readInt32BE());
var k1 = Math.pow((v - parseInt(x1, 16)),
private_D.readInt32BE());
console.log("nprivate_D
"+private_D.readInt32BE());
console.log("k0: "+k0);
console.log("k1: "+k1);
var m0_ = parseInt(m0, 16) + parseInt(k0,
16);
var m1_ = parseInt(m1,16) + parseInt(k1,
16);
console.log(" nm0': "+m0_);
console.log("m1': "+m1_);
//console.log(m0_);
//console.log((m1_ - parseInt(k1,
16)).toString(16));
console.log("n[TRANSFER] Alice's created
m0', m1' => Bob");
return bob_2(m0_, m1_, k0, k1);
}
function bob_2(m0_, m1_, k0, k1){
console.log("nn============= ALICE STEP
#2 ================");
console.log("[RECEIVED] m0': "+m0_);
console.log("[RECEIVED] m1': "+m1_);
var mb;
//console.log(mb);
if(isNaN(m0_)){
mb = (m1_ - parseInt(k1,
16)).toString(16);
}else{
mb = (m0_ - parseInt(k0,
16)).toString(16);
}
console.log("nmb: "+m1_);
console.log("nmb.toString() (Bob's
decrypted message) : "+hex2a(mb));
//console.log(hex2a(mb));
return hex2a(mb);
}
var public_key;
app.get('/send', function(request, response)
{
//response.render('pages/inbox');
//console.log(request.query.subject);
// Original Message
var msg = request.query.text;
var decrypted_msg = alice_1(msg);
var mail = new Mail({
subject: request.query.subject,
text: decrypted_msg
});
mail.save(function(err){
if(err){
console.error(err);
response.json({ msg: "ERR"});
return;
}
Digital Certified Mail
San Jose State University, CMPE 209 Project,
Group 9
9
response.json({ msg: "OK"});
});
});
function makeid()
{
var text = "";
var possible =
"ABCDEFGabcdef0123456789";
for( var i=0; i < 2; i++ )
text +=
possible.charAt(Math.floor(Math.random() *
possible.length));
return text;
}
function a2hex(str) {
var arr = [];
for (var i = 0, l = str.length; i < l; i
++) {
var hex =
Number(str.charCodeAt(i)).toString(16);
arr.push(hex);
}
return arr.join('');
}
function hex2a(hexx) {
var hex = hexx.toString();//force
conversion
var str = '';
for (var i = 0; i < hex.length; i += 2)
str +=
String.fromCharCode(parseInt(hex.substr(i,
2), 16));
return str;
}
app.listen(app.get('port'), function() {
console.log('Node app is running on port',
app.get('port'));
});
REFERENCES
[1] Michael O. Rabin. 1981. How to exchange secrets by
oblivious transfer. Technical Report TR-81, Aiken
Computation Laboratory, Harvard University
[2] S. Even, O. Goldreich, and A. Lempel. 1985. A
Randomized Protocol for Signing
Contracts, Communications of the ACM, Volume 28,
Issue 6, pg. 637–64
[3] Zimmermann, Philip R. 1999. Why I Wrote PGP. Essays
on PGP. Philip Zimmermann

More Related Content

What's hot

Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket LayerNaveen Kumar
 
Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)Sandeep Gupta
 
E mail security using Certified Electronic Mail (CEM)
E mail security using Certified Electronic Mail (CEM)E mail security using Certified Electronic Mail (CEM)
E mail security using Certified Electronic Mail (CEM)Pankaj Bhambhani
 
Digital signature(Cryptography)
Digital signature(Cryptography)Digital signature(Cryptography)
Digital signature(Cryptography)Soham Kansodaria
 
Digital Signatures
Digital SignaturesDigital Signatures
Digital SignaturesEhtisham Ali
 
Transport layer security (tls)
Transport layer security (tls)Transport layer security (tls)
Transport layer security (tls)Kalpesh Kalekar
 
Secure shell ppt
Secure shell pptSecure shell ppt
Secure shell pptsravya raju
 
Elgamal Digital Signature
Elgamal Digital SignatureElgamal Digital Signature
Elgamal Digital SignatureSou Jana
 
E-mail Security in Network Security NS5
E-mail Security in Network Security NS5E-mail Security in Network Security NS5
E-mail Security in Network Security NS5koolkampus
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptxsamimaqbol
 

What's hot (20)

Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
 
Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)Ssl (Secure Socket Layer)
Ssl (Secure Socket Layer)
 
Public key algorithm
Public key algorithmPublic key algorithm
Public key algorithm
 
E mail security using Certified Electronic Mail (CEM)
E mail security using Certified Electronic Mail (CEM)E mail security using Certified Electronic Mail (CEM)
E mail security using Certified Electronic Mail (CEM)
 
SSL And TLS
SSL And TLS SSL And TLS
SSL And TLS
 
Digital signature(Cryptography)
Digital signature(Cryptography)Digital signature(Cryptography)
Digital signature(Cryptography)
 
Digital Signatures
Digital SignaturesDigital Signatures
Digital Signatures
 
Transport layer security (tls)
Transport layer security (tls)Transport layer security (tls)
Transport layer security (tls)
 
Secure shell ppt
Secure shell pptSecure shell ppt
Secure shell ppt
 
Elgamal Digital Signature
Elgamal Digital SignatureElgamal Digital Signature
Elgamal Digital Signature
 
E-mail Security in Network Security NS5
E-mail Security in Network Security NS5E-mail Security in Network Security NS5
E-mail Security in Network Security NS5
 
Digital certificates
Digital certificatesDigital certificates
Digital certificates
 
Kerberos
KerberosKerberos
Kerberos
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptx
 
Public key Infrastructure (PKI)
Public key Infrastructure (PKI)Public key Infrastructure (PKI)
Public key Infrastructure (PKI)
 
Fundamentals of cryptography
Fundamentals of cryptographyFundamentals of cryptography
Fundamentals of cryptography
 
SSL
SSLSSL
SSL
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Blockchain Assignment
Blockchain AssignmentBlockchain Assignment
Blockchain Assignment
 

Similar to Digital Certified Mail

Secure Mail Application's by Ashok Panwar
Secure Mail Application's by Ashok PanwarSecure Mail Application's by Ashok Panwar
Secure Mail Application's by Ashok PanwarAshok Panwar
 
network and cyber security
network and cyber securitynetwork and cyber security
network and cyber securityShruthi Reddy
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptographyRutvik Mehta
 
B. Nouri-Moghaddam et al Int. Journal of Engineering Research .docx
B. Nouri-Moghaddam et al Int. Journal of Engineering Research .docxB. Nouri-Moghaddam et al Int. Journal of Engineering Research .docx
B. Nouri-Moghaddam et al Int. Journal of Engineering Research .docxikirkton
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its UsesMohsin Ali
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Email Encryption using Tri-Cryptosystem Based on Android
Email Encryption using Tri-Cryptosystem Based on AndroidEmail Encryption using Tri-Cryptosystem Based on Android
Email Encryption using Tri-Cryptosystem Based on AndroidIRJET Journal
 
Celebrity Cricket League 2016 - http://ccl5.com/
Celebrity Cricket League 2016 - http://ccl5.com/ Celebrity Cricket League 2016 - http://ccl5.com/
Celebrity Cricket League 2016 - http://ccl5.com/ Tania Agni
 
Deniable Encryption Key
Deniable Encryption KeyDeniable Encryption Key
Deniable Encryption KeyIOSR Journals
 

Similar to Digital Certified Mail (20)

Pgp
PgpPgp
Pgp
 
Unit 4
Unit 4Unit 4
Unit 4
 
Pgp
PgpPgp
Pgp
 
PGP.ppt
PGP.pptPGP.ppt
PGP.ppt
 
Network Security CS2
Network Security CS2Network Security CS2
Network Security CS2
 
Pgp
PgpPgp
Pgp
 
Cryptography & Security
Cryptography & SecurityCryptography & Security
Cryptography & Security
 
Secure Mail Application's by Ashok Panwar
Secure Mail Application's by Ashok PanwarSecure Mail Application's by Ashok Panwar
Secure Mail Application's by Ashok Panwar
 
Ch15
Ch15Ch15
Ch15
 
network and cyber security
network and cyber securitynetwork and cyber security
network and cyber security
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptography
 
G43053847
G43053847G43053847
G43053847
 
B. Nouri-Moghaddam et al Int. Journal of Engineering Research .docx
B. Nouri-Moghaddam et al Int. Journal of Engineering Research .docxB. Nouri-Moghaddam et al Int. Journal of Engineering Research .docx
B. Nouri-Moghaddam et al Int. Journal of Engineering Research .docx
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its Uses
 
network security
network securitynetwork security
network security
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Email Encryption using Tri-Cryptosystem Based on Android
Email Encryption using Tri-Cryptosystem Based on AndroidEmail Encryption using Tri-Cryptosystem Based on Android
Email Encryption using Tri-Cryptosystem Based on Android
 
Celebrity Cricket League 2016 - http://ccl5.com/
Celebrity Cricket League 2016 - http://ccl5.com/ Celebrity Cricket League 2016 - http://ccl5.com/
Celebrity Cricket League 2016 - http://ccl5.com/
 
Deniable Encryption Key
Deniable Encryption KeyDeniable Encryption Key
Deniable Encryption Key
 
Network security cs9 10
Network security  cs9 10Network security  cs9 10
Network security cs9 10
 

More from Matthew Chang

Research and Analysis of SSH
Research and Analysis of SSH Research and Analysis of SSH
Research and Analysis of SSH Matthew Chang
 
Twitter Trend Analyzer
Twitter Trend AnalyzerTwitter Trend Analyzer
Twitter Trend AnalyzerMatthew Chang
 
The implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserThe implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserMatthew Chang
 
Image Compression Storage Policy for Openstack Swift
Image Compression Storage Policy for Openstack SwiftImage Compression Storage Policy for Openstack Swift
Image Compression Storage Policy for Openstack SwiftMatthew Chang
 
Analyze of Tumblr.com
Analyze of Tumblr.comAnalyze of Tumblr.com
Analyze of Tumblr.comMatthew Chang
 
A new interface between smart device and web using html5 web socket and qr code
A new interface between smart device and web using html5 web socket and qr codeA new interface between smart device and web using html5 web socket and qr code
A new interface between smart device and web using html5 web socket and qr codeMatthew Chang
 
Logic Circuit Project Final Presentation
Logic Circuit Project Final PresentationLogic Circuit Project Final Presentation
Logic Circuit Project Final PresentationMatthew Chang
 
Programming Language Final PPT
Programming Language Final PPTProgramming Language Final PPT
Programming Language Final PPTMatthew Chang
 
Profile_ Ikwhan chang
Profile_ Ikwhan changProfile_ Ikwhan chang
Profile_ Ikwhan changMatthew Chang
 
모바일 앱 개발 최종 발표 Proposal
모바일 앱 개발 최종 발표 Proposal모바일 앱 개발 최종 발표 Proposal
모바일 앱 개발 최종 발표 ProposalMatthew Chang
 
Capstone Project Final Presentation
Capstone Project Final PresentationCapstone Project Final Presentation
Capstone Project Final PresentationMatthew Chang
 
Project Avalon Online(Game) Final Report
Project Avalon Online(Game) Final ReportProject Avalon Online(Game) Final Report
Project Avalon Online(Game) Final ReportMatthew Chang
 
Project NGX - Proposal
Project NGX - ProposalProject NGX - Proposal
Project NGX - ProposalMatthew Chang
 
Report : Android Simple Bug Catch Game(Korean)
Report : Android Simple Bug Catch Game(Korean)Report : Android Simple Bug Catch Game(Korean)
Report : Android Simple Bug Catch Game(Korean)Matthew Chang
 
Capstone Project Last Demonstration
Capstone Project Last DemonstrationCapstone Project Last Demonstration
Capstone Project Last DemonstrationMatthew Chang
 
Db설계 프로젝트 1조 _중간제출
Db설계 프로젝트 1조 _중간제출Db설계 프로젝트 1조 _중간제출
Db설계 프로젝트 1조 _중간제출Matthew Chang
 
​Presentation team ngx 5주차 발표자료
​Presentation team ngx 5주차 발표자료​Presentation team ngx 5주차 발표자료
​Presentation team ngx 5주차 발표자료Matthew Chang
 

More from Matthew Chang (20)

Research and Analysis of SSH
Research and Analysis of SSH Research and Analysis of SSH
Research and Analysis of SSH
 
Twitter Trend Analyzer
Twitter Trend AnalyzerTwitter Trend Analyzer
Twitter Trend Analyzer
 
The implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserThe implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parser
 
Image Compression Storage Policy for Openstack Swift
Image Compression Storage Policy for Openstack SwiftImage Compression Storage Policy for Openstack Swift
Image Compression Storage Policy for Openstack Swift
 
Urhyme introduction
Urhyme introductionUrhyme introduction
Urhyme introduction
 
SDN Project PPT
SDN Project PPTSDN Project PPT
SDN Project PPT
 
Analyze of Tumblr.com
Analyze of Tumblr.comAnalyze of Tumblr.com
Analyze of Tumblr.com
 
Project Avalon
Project AvalonProject Avalon
Project Avalon
 
A new interface between smart device and web using html5 web socket and qr code
A new interface between smart device and web using html5 web socket and qr codeA new interface between smart device and web using html5 web socket and qr code
A new interface between smart device and web using html5 web socket and qr code
 
Logic Circuit Project Final Presentation
Logic Circuit Project Final PresentationLogic Circuit Project Final Presentation
Logic Circuit Project Final Presentation
 
Programming Language Final PPT
Programming Language Final PPTProgramming Language Final PPT
Programming Language Final PPT
 
Profile_ Ikwhan chang
Profile_ Ikwhan changProfile_ Ikwhan chang
Profile_ Ikwhan chang
 
모바일 앱 개발 최종 발표 Proposal
모바일 앱 개발 최종 발표 Proposal모바일 앱 개발 최종 발표 Proposal
모바일 앱 개발 최종 발표 Proposal
 
Capstone Project Final Presentation
Capstone Project Final PresentationCapstone Project Final Presentation
Capstone Project Final Presentation
 
Project Avalon Online(Game) Final Report
Project Avalon Online(Game) Final ReportProject Avalon Online(Game) Final Report
Project Avalon Online(Game) Final Report
 
Project NGX - Proposal
Project NGX - ProposalProject NGX - Proposal
Project NGX - Proposal
 
Report : Android Simple Bug Catch Game(Korean)
Report : Android Simple Bug Catch Game(Korean)Report : Android Simple Bug Catch Game(Korean)
Report : Android Simple Bug Catch Game(Korean)
 
Capstone Project Last Demonstration
Capstone Project Last DemonstrationCapstone Project Last Demonstration
Capstone Project Last Demonstration
 
Db설계 프로젝트 1조 _중간제출
Db설계 프로젝트 1조 _중간제출Db설계 프로젝트 1조 _중간제출
Db설계 프로젝트 1조 _중간제출
 
​Presentation team ngx 5주차 발표자료
​Presentation team ngx 5주차 발표자료​Presentation team ngx 5주차 발표자료
​Presentation team ngx 5주차 발표자료
 

Recently uploaded

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Recently uploaded (20)

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

Digital Certified Mail

  • 1. Digital Certified Mail Group 9 Baek Soo Kwak Department of Computer Engineering San Jose State University baeksoo.kwak@sjsu.edu Ikwhan Chang Department of Computer Engineering San Jose State University Ikwhan.chang@sjsu.edu ABSTRACT We investigated on digital certified mail system and pretty good privacy protocol which is applied to the email security. Both email securing methodologies are implemented by NodeJS and deployed the basic mechanism to exchange the messages. Key security parts of digital certified mail are by using the oblivious transfer protocol which does not necessarily specify selection of keys and messages. Furthermore, PGP applied to email system was studied to be compared with the digital certified mail. KEYWORDS RSA, AES, Asymmetric, Oblivious Transfer Protocol, Digital Certified Mail, Pretty Good Privacy 1 INTRODUCTION Today email is the most used media in exchanging messages and information between people and groups. However, there are not many known efficient ways of securing the email system, since it is also one of the challenging parts due to trade-off among performance and security. In this project, we have done research on the digitally certified mail up to implementing the base algorithm and then, went through more on pretty good privacy (PGP) applied to the email system. 2 BACKGROUND Digital certified mail is one of the suggested methods before, and it was invented in a few decades ago so, it would not be fully utilizing now. This is using a base protocol called oblivious transfer protocol, and the story should be started from the situation where signing contract over the network. The best way must be a physical solution where two parties are sitting together to sign the contracts at the same time, and then exchange the signed documents in that place. However, the scenario needs to be modified when it is happening over the network. In general, fair exchange of keys and messages between sender and receiver are desired, but probably fail all or success all. The base of digitally certified mail system is from oblivious transfer protocol, and we tried to implement this algorithm by using NodeJS. 3 OBLIVIOUS TRANSFER PROTOCOL Oblivious Transfer Protocol has a mechanism that a receiver wants to have a specific message from a sender without notifying the selection to the sender, and the sender transmits all encrypted messages based on the protocol oblivious to what receiver get as she/he want. The key security characteristic comes from the facts that the receiver and sender do not need to specify selection and keys, but they can do exchange what they want to transfer. Here is the description of basic 1-2 Oblivious Transfer Protocol to go for digitally certified mail system. Figure 1: The basic steps of oblivious transfer protocol
  • 2. Digital Certified Mail Group 9 2 Above table shows the steps for 1-2 oblivious transfer protocol that the sender has two messages m0 and m1, and the receiver has a selection bit b. Here the receiver wants to receive mb, without the sender knowing b, while the sender wants to make sure that the receiver receives only one of the two messages. The protocol can be instantiated using RSA encryption. 4 PRETTY GOOD PRIVACY PGP is a popular program used to encrypt and decrypt Internet e-mail. It can also be used to send an encrypted digital signature that identifies the identity of the sender so that it can be assured that the message has not changed in transit. PGP is a freeware, low-cost commercial version, and is the most widely used confidentiality program by individuals and businesses. This program was developed by Philip R. Zimmermann in 1991 and became the de facto standard in e-mail security. PGP can also be used to encrypt and store files so that they cannot be read by other users or intruders. 4.1 How it works PGP uses a variant of the public key system. In a public-key system, each user has a publicly known cryptographic key and only a private key known only to that user. The user encrypts the message he or she wants to send using the recipient's public key. When the recipient receives it, they decrypt it with their private key. Because encrypting the entire message can take time, PGP uses a faster encryption algorithm to encrypt the message and then uses the public key to encrypt the short key that was used to encrypt the entire message. Both the encrypted message and the short key are sent to the recipient who first uses his private key to decrypt the short key and then uses the short key to decrypt the entire message. PGP comes in two public-key versions: RSA and Diffie-Hellman. In the RSA version, the IDEA algorithm is used to generate the short key used to encrypt the entire message, and RSA is used to encrypt the short key. The Diffie-Hellman version uses the CAST algorithm for short keys to encrypt the entire message and uses the Diffie-Hellman algorithm to encrypt the short keys. To send a digital signature, PGP uses an efficient algorithm to generate a hash code from the user's name and other signature information. This hash code is encrypted with the sender's private key. The recipient uses the sender's public key to decrypt the hash code. If it matches a hash code sent as an electronic signature for the message, the recipient can be assured that the message arrived safely from the sender who signed it. The RSA version of PGP uses the MD5 algorithm to generate hash codes. The Diffie-Hellman version of PGP uses the SHA-1 algorithm to generate hash codes. To use PGP, you must download it or purchase it and install it on your computer system. In general, it includes a user interface that works with your favorite e-mail program. Users need to register their public key with their PGP public key server so that people who will exchange messages with them will be able to find their public keys. Network Associates maintains an LDAP / HTTP public key server with 300,000 registered public keys. This server is mirrored to other sites around the world. 4.2 Where can I use PGP? Originally, the US government limited the export of PGP technology. However, PGP-encrypted e-mail today can also be exchanged with users outside the United States if they have the correct version of PGP on both sides. The international version of PGP is as secure as the national version used in the US, unlike most other encryption products. It is illegal to use freely available PGP freeware for commercial purposes, in which case you must purchase a commercial version from Network Associates (formerly PGP, Inc.). There are several versions of PGP currently in use. Additional programs are available to keep the new RSA version compatible with previous versions. However, PGP's Diffie-Hellman and RSA versions do not work together because they use different algorithms. This term was originally written by Sabrina Dei Giudici of Web Marketing, based in Western Australia. William Stallings's paper "Getting Cryptic - PGP or You and Me" is a great resource. PGP's homepage is now at Network Associates.
  • 3. Digital Certified Mail San Jose State University, CMPE 209 Project, Group 9 3 For more information about PGP, or to download the latest version, please visit International PGP Page. 5 IMPLEMENTATION 5.1. SW Specification - Backend/Frontend: Node.js v7.7.4 - Language: JavaScript - DBMS: Mongo DB v3.4.4 - Public Repository: https://github.com/IkwhanChang/certified- mail 5.2. How to run 1) Copy the source code: git clone https://github.com/IkwhanChang/certified- mail 2) Install the dependencies: npm install 3) Install MongoDB by using instruction manual: https://docs.mongodb.com/manual/installation / 4) Run the MongoDB: sudo mongod and create the database of “Mail” 5) Run the server: node receiver.js 6) Connect the GUI: http://localhost:5001 7) Compose any email and see the console output 5.3 SW Architecture Figure 2. Software Architecture In our project, we used node.js and express.js To use the RSA algorithm; we use the node-rsa (https://github.com/rzcoder/node-rsa) 5.4 User Interface We have three GUI user interface: 1) Inbox: to see every email that received from the start 2) Compose: to compose the email with WYSIWYG text editor 3) View: to see specific email Figure 3. Inbox Figure 4. Compose Email Figure 5. View Mail 5.5 Algorithms and Code - Step 1 – Alice send the N, e, x1, x2 Table 1. Step 1
  • 4. Digital Certified Mail Group 9 4 In this logic, Alice will create the RSA key pair and send the public portion (N, e) and two random messages generated by Alice to the Bob. Thus, Bob will receive (N, e) and x0 and x1 Related Source Code function alice_1(msg) { console.log("nn============= ALICE STEP #1 ================"); console.log("============= MSG : "+msg.trim() + "================"); m0 = a2hex(msg.trim().split(' ')[0]); m1 = a2hex(msg.trim().split(' ')[1]); console.log(""); console.log("m0 : "+m0); console.log("m1 : "+m1); var key = new NodeRSA({b: 16}); var bit = 2048; var exp = 65537; console.log(""); console.log("Bit: "+ bit); console.log("Exp: "+ exp); key.generateKeyPair(bit, exp); console.log(""); console.log("=> PUBLIC/PRIVATE KEY"); console.log(key.exportKey('pkcs1')); console.log(key.exportKey('components')); private_D =key.exportKey('components').d; public_N = key.exportKey('components').n; public_E = key.exportKey('components').e; // Alice's public N, e => Bob console.log(""); console.log("[TRANSFER] Alice's public N, e => Bob"); return bob_1(key.exportKey('components').n, key.exportKey('components').e); } In above code, the message will be split by space (e.g. original message: Hello World, split message: Hello / World) Then, we will convert that message from ASCII to Hex for calculating. Afterward, RSA key pair will be generated by using the node-RSA library and the definition of bit and exponent (in this example, 65537 of the exponent) Finally, Alice is ready to send the public key pairs. Figure 6. Console result of step 1 - Step 2: Bob select b and either x0 or x1, generate v and send v to the Alice Table 2. Step 2 In this step, first Bob need to select either x0 or x1 that received from Alice. Once Bob select, the selected xb will be used for creating the v by using equation of v = (xb + k^e) mod N. Finally, the N will be sent to the Alice. Related Source Code function bob_1(public_N, public_E){ console.log("nn============= BOB STEP #1 ================"); console.log("[RECEIVED] public_N: "+public_N.readInt32BE()); console.log("[RECEIVED] public_E': "+public_E); //var private_D =key.exportKey('components').d; // BOB //var public_N = key.exportKey('components').n; //var public_E = key.exportKey('components').e; var x0 = makeid(); var x1 = makeid(); console.log("nx0: "+ x0); console.log("x1: "+ x1);
  • 5. Digital Certified Mail San Jose State University, CMPE 209 Project, Group 9 5 var xb; var b = Math.random() < 0.5 ? 1 : 0; console.log("nChoose b in {0,1}: "+ b); if(b === 0){ xb = x0; console.log("Xb: x0"); }else{ xb = x1; console.log("Xb: x1"); } var k = 1;//Math.floor(Math.random() * 20)/100; //console.log(parseInt(xb, 16)); var v = (parseInt(xb, 16) + math.mod(Math.pow(k, public_E), public_N.readInt32BE())); console.log("nv: "+v); console.log("n[TRANSFER] Bob's v, x0, x1 => Alice"); return alice_2(v, x0, x1); } In the above code, we used static k of 1 because since we have a large number of the exponent (in this example 65531), it took a long time to calculate the v . Plus, we used the HEX to calculate every key since we have a large number of the original message. Figure 7. Console result of step 2 - Step 3: Alice generate k0 and k1, send them to the Bob, and get the original split message Table 3. Step 3 In this final step, Alice will create k0 and k1 by using the v that received in the previous step. Once Alice calculates k0 and k1, then m'0 and m'1 can be created. Then, Alice sends those extra messages to the Bob. Once Bob received the k0 and k1, Bob can simply compare with k that he randomly selected in the previous step. If either m'0 or m'1 is null or infinity number, then we can simply know which m is the original message. Finally, Bob can know the original split message. Related Source Code function alice_2(v, x0, x1) { console.log("nn============= ALICE STEP #2 ================"); console.log("[RECEIVED] v: "+v); console.log("[RECEIVED] x0': "+x0); console.log("[RECEIVED] x1': "+x1); // ALICE //var public_N = key.exportKey('components').n; var k0 = Math.pow((v - parseInt(x0, 16)), private_D.readInt32BE()); var k1 = Math.pow((v - parseInt(x1, 16)), private_D.readInt32BE()); console.log("nprivate_D "+private_D.readInt32BE()); console.log("k0: "+k0); console.log("k1: "+k1); var m0_ = parseInt(m0, 16) + parseInt(k0, 16); var m1_ = parseInt(m1,16) + parseInt(k1, 16); console.log(" nm0': "+m0_); console.log("m1': "+m1_); //console.log(m0_); //console.log((m1_ - parseInt(k1, 16)).toString(16)); console.log("n[TRANSFER] Alice's created m0', m1' => Bob");
  • 6. Digital Certified Mail Group 9 6 return bob_2(m0_, m1_, k0, k1); } function bob_2(m0_, m1_, k0, k1){ console.log("nn============= ALICE STEP #2 ================"); console.log("[RECEIVED] m0': "+m0_); console.log("[RECEIVED] m1': "+m1_); var mb; //console.log(mb); if(isNaN(m0_)){ mb = (m1_ - parseInt(k1, 16)).toString(16); }else{ mb = (m0_ - parseInt(k0, 16)).toString(16); } console.log("nmb: "+m1_); console.log("nmb.toString() (Bob's decrypted message) : "+hex2a(mb)); //console.log(hex2a(mb)); return hex2a(mb); } The final result is hex2a(mb) (hex2a() is convert from hex to ASCII) Figure 8. Console result of step 3 Appendix A. Full Source Code Frontend Script.js $(document).ready(function(){ 'use strict'; $("#btn_send").click(function(e){ //alert($("#email-editor").html()); //alert($("#email-editor").code()); $.get("/send", { subject: $("#subject").val(), text: $("#email-editor").code() }, function(response){ location.href = '/'; }); e.preventDefault(); }); $.get("/getAll", function(response){ console.log(response); $.each(response, function(key, value){ $(".email-list").append('<div class="item" onclick="location.href='/view/'+value._id+' '"><div><div class="am-checkbox"><input id="check3" type="checkbox"><label for="check3"></label></div></div><div><span class="date pull-right"><i class="icon s7- paperclip"></i>'+value.published_date.substr ing(0,10)+'</span><h4 class="from">Alice Lee</h4><p class="msg">'+value.subject+'</p></div></div >'); }); }); }); Backend Server.js var express = require('express'); var app = express(); var mongoose = require('mongoose'); var NodeRSA = require('node-rsa'); // DEFINE MODEL var Mail = require('./mail'); var math = require('mathjs'); // CONNECT TO MONGODB SERVER var db = mongoose.connection; db.on('error', console.error); db.once('open', function(){ // CONNECTED TO MONGODB SERVER
  • 7. Digital Certified Mail San Jose State University, CMPE 209 Project, Group 9 7 console.log("Connected to mongod server"); }); mongoose.connect('mongodb://localhost/Mail') ; app.set('port', (process.env.PORT || 5001)); app.use(express.static(__dirname + '/public')); // views is directory for all template files app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.get('/', function(request, response) { response.render('pages/inbox'); }); app.get('/compose', function(request, response) { response.render('pages/compose'); }); app.get('/view/:id', function(request, response) { Mail.findOne({_id: request.params.id}, function(err, email){ if(err) return res.status(500).send({error: 'database failure'}); console.log(email.subject); response.render('pages/view', {subject: email.subject, text: email.text}); //response.json(mails); }) }); app.get('/getAll', function(request, response) { Mail.find(function(err, mails){ if(err) return res.status(500).send({error: 'database failure'}); response.json(mails); }) }); var private_D, public_N, public_e; var m0, m1; function alice_1(msg) { console.log("nn============= ALICE STEP #1 ================"); console.log("============= MSG : "+msg.trim() + "================"); m0 = a2hex(msg.trim().split(' ')[0]); m1 = a2hex(msg.trim().split(' ')[1]); console.log(""); console.log("m0 : "+m0); console.log("m1 : "+m1); var key = new NodeRSA({b: 16}); var bit = 2048; var exp = 65537; console.log(""); console.log("Bit: "+ bit); console.log("Exp: "+ exp); key.generateKeyPair(bit, exp); console.log(""); console.log("=> PUBLIC/PRIVATE KEY"); console.log(key.exportKey('pkcs1')); console.log(key.exportKey('components')); private_D =key.exportKey('components').d; public_N = key.exportKey('components').n; public_E = key.exportKey('components').e; // Alice's public N, e => Bob console.log(""); console.log("[TRANSFER] Alice's public N, e => Bob"); return bob_1(key.exportKey('components').n, key.exportKey('components').e); } function bob_1(public_N, public_E){ console.log("nn============= BOB STEP #1 ================"); console.log("[RECEIVED] public_N: "+public_N.readInt32BE()); console.log("[RECEIVED] public_E': "+public_E); //var private_D =key.exportKey('components').d; // BOB //var public_N = key.exportKey('components').n; //var public_E = key.exportKey('components').e; var x0 = makeid(); var x1 = makeid(); console.log("nx0: "+ x0);
  • 8. Digital Certified Mail Group 9 8 console.log("x1: "+ x1); var xb; var b = Math.random() < 0.5 ? 1 : 0; console.log("nChoose b in {0,1}: "+ b); if(b === 0){ xb = x0; console.log("Xb: x0"); }else{ xb = x1; console.log("Xb: x1"); } var k = 1;//Math.floor(Math.random() * 20)/100; //console.log(parseInt(xb, 16)); var v = (parseInt(xb, 16) + math.mod(Math.pow(k, public_E), public_N.readInt32BE())); console.log("nv: "+v); console.log("n[TRANSFER] Bob's v, x0, x1 => Alice"); return alice_2(v, x0, x1); } function alice_2(v, x0, x1) { console.log("nn============= ALICE STEP #2 ================"); console.log("[RECEIVED] v: "+v); console.log("[RECEIVED] x0': "+x0); console.log("[RECEIVED] x1': "+x1); // ALICE //var public_N = key.exportKey('components').n; var k0 = Math.pow((v - parseInt(x0, 16)), private_D.readInt32BE()); var k1 = Math.pow((v - parseInt(x1, 16)), private_D.readInt32BE()); console.log("nprivate_D "+private_D.readInt32BE()); console.log("k0: "+k0); console.log("k1: "+k1); var m0_ = parseInt(m0, 16) + parseInt(k0, 16); var m1_ = parseInt(m1,16) + parseInt(k1, 16); console.log(" nm0': "+m0_); console.log("m1': "+m1_); //console.log(m0_); //console.log((m1_ - parseInt(k1, 16)).toString(16)); console.log("n[TRANSFER] Alice's created m0', m1' => Bob"); return bob_2(m0_, m1_, k0, k1); } function bob_2(m0_, m1_, k0, k1){ console.log("nn============= ALICE STEP #2 ================"); console.log("[RECEIVED] m0': "+m0_); console.log("[RECEIVED] m1': "+m1_); var mb; //console.log(mb); if(isNaN(m0_)){ mb = (m1_ - parseInt(k1, 16)).toString(16); }else{ mb = (m0_ - parseInt(k0, 16)).toString(16); } console.log("nmb: "+m1_); console.log("nmb.toString() (Bob's decrypted message) : "+hex2a(mb)); //console.log(hex2a(mb)); return hex2a(mb); } var public_key; app.get('/send', function(request, response) { //response.render('pages/inbox'); //console.log(request.query.subject); // Original Message var msg = request.query.text; var decrypted_msg = alice_1(msg); var mail = new Mail({ subject: request.query.subject, text: decrypted_msg }); mail.save(function(err){ if(err){ console.error(err); response.json({ msg: "ERR"}); return; }
  • 9. Digital Certified Mail San Jose State University, CMPE 209 Project, Group 9 9 response.json({ msg: "OK"}); }); }); function makeid() { var text = ""; var possible = "ABCDEFGabcdef0123456789"; for( var i=0; i < 2; i++ ) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } function a2hex(str) { var arr = []; for (var i = 0, l = str.length; i < l; i ++) { var hex = Number(str.charCodeAt(i)).toString(16); arr.push(hex); } return arr.join(''); } function hex2a(hexx) { var hex = hexx.toString();//force conversion var str = ''; for (var i = 0; i < hex.length; i += 2) str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); return str; } app.listen(app.get('port'), function() { console.log('Node app is running on port', app.get('port')); }); REFERENCES [1] Michael O. Rabin. 1981. How to exchange secrets by oblivious transfer. Technical Report TR-81, Aiken Computation Laboratory, Harvard University [2] S. Even, O. Goldreich, and A. Lempel. 1985. A Randomized Protocol for Signing Contracts, Communications of the ACM, Volume 28, Issue 6, pg. 637–64 [3] Zimmermann, Philip R. 1999. Why I Wrote PGP. Essays on PGP. Philip Zimmermann