You are on page 1of 4

A Public Key Cryptosystem Based on Number

Theory
Ashish Agarwala

R Saravanan

School of Computing Science and Engineering, VIT


University, Vellore-632014, Tamil Nadu, India
agarwal.ashish62@gmail.com

School of Information Technology and Engineering, VIT


University, Vellore 632014, Tamil Nadu, India
rsaravanan@vit.ac.in

Abstract Public Key Cryptosystem came into existence after


1975.Since then a large number of research has been conducted
in this area. It is based on number theory and exploits the
features of computationally hard problems, namely integer
factorization, discrete logarithmic problem to name a few. In this
paper we describe a public-key cryptosystem. The basis of the
design is derived from first version of Eulers Theorem. Apart
from exponentiation and residue to a modulus, it is also based on
some base and remainder. The remainder plays a crucial role on
the selection of the exponents. The base is used to generate the
residue to a modulus. Both the base and the remainder make
cryptanalysis tough.
Keywords - Public-key cryptosystem, Private-key cryptosystem,
algorithm, encryption, decryption, key-generation.

1.

INTRODUCTION

Information and Communication security has become


extremely important in todays world. We communicate and
exchange information with each other over the public and
private networks. Preserving security and privacy of the data
and information is crucial to any organization. Cryptography
thus plays a vital role in preserving security and privacy. The
word Cryptology is the combination of Cryptography and
Cryptanalysis. Cryptography is a Greek word which means
secret writing. It is the art and science of making codes. It is
the practice and study of hiding information. Whereas
Cryptanalysis refers to the art of breaking codes and to analyze
various weakness of a cryptosystem. Confidentiality, integrity,
availability, authentication, digital signature, non-repudiation
are some important security goals. To ensure confidentiality,
integrity and authentication, cryptography is inevitable.
Modern day cryptography is broadly divided into two
categories: Private-key cryptography and Public-key
cryptography.
A. Public-key Cryptography
PKC is based on prime numbers, integer factorization,
exponentiation, probability and discrete logarithmic problem.
The secret is personal; each person creates and keeps his or
her own secret. In a community of n people only n personal
secrets are needed. They are based on applying mathematical

c
978-1-4673-0255-5/12/$31.00 2012
IEEE

functions to numbers. The public-key algorithms are used to


create a mathematically related key pair: a secret private
key and a published public key. It allows confidentiality,
authentication of a message by encrypting the message
using the public key, which can only be decrypted using
the private key. RSA, ElGamal, Rabin, ECC are some well
known public-key cryptosystem.
Public-key cryptosystem was published in 1976 by Whitfield
Diffie and Martin Hellman, who disclosed a method of publickey agreement. This method of key exchange, which uses
exponentiation came to be known as DiffieHellman key
exchange, became the basis of Public-key cryptosystem.
Public-key cryptography is based on applying
mathematical functions to numbers. The plaintext and cipher
text are numbers; encryption and decryption are mathematical
functions that are applied to numbers to create other numbers.
Keys: Public-key cryptography uses two separate or
distinct mathematically related key pairs. If data is
locked with a public key then it can only be unlocked
with the corresponding private key.
General Overview:
Receiver
To Public

Key Generation
Public Key
Distribution
Channel

Public Keys () //Distribute


Private Keys () //Secret

Public Keys ()
Private Keys ()

Sender

Cipher
Text
Plaintext

Encryption ()

Decryption ()

Plaintext

Fig.1.1 Overview of Public-Key Cryptosystem


Figure 1.1 represents the general idea of public-key
cryptosystem. The burden of providing security is mostly on

238

the receiver. The receiver needs to create two keys: one


private and one public. Receiver then distributes the public
keys to the community and retains the private keys with him.
This can be done through a public key distribution channel.
The public and private keys are different. Each entity in the
community should create its own private and public keys.
Anyone can communicate with the receiver using the public
keys and the receiver needs only one private key to receive all
correspondence. Thus the sender needs n public keys to
communicate with n entities in the community.
Plaintext/Cipher text. Plaintext and Cipher text are
treated as integers. The message must be encoded as
an integer or a set of integers before encryption; the
integer or the set of integers must be decoded into the
message after decryption. It is normally used to
encrypt or decrypt small pieces of information.
Encryption/Decryption. Encryption and decryption
in public-key cryptosystem are mathematical
functions applied over the numbers representing the
plaintext and cipher text. The cipher text can be
thought of as
C=f (Kpublic, P); the plaintext can be
thought of as P= g (Kprivate, C).

II.

DESCRIPTION OF THE PROPOSED PUBLIC-KEY


CRYPTOSYSTEM
The basis of the design is derived from first version of Eulers
Theorem. Apart from exponentiation and residue to a
modulus, it is also based on some base and remainder. The
remainder plays a crucial role on the selection of the
exponents. The base is used to generate the residue to a
modulus. Both the base and the remainder make cryptanalysis
tough.
First Version of Eulers theorem states:
a (n) 1 mod n where gcd(a,n) = 1
Now if we multiply k a number, with (n) in the above
relation, we get
a k* (n) 1 mod n

(1)

Also if we multiply a to the power r on both sides of (1) we


get

B. Trapdoor One-Way Function

a k* (n) *a r a r mod n,

The main idea behind public-key cryptography is the


concept of the trapdoor one-way function.

a k* (n) + r a r mod n

(2)

p k* (n) +r *a k* (n) +r (p r *a r) mod n, where


p is a number

Functions: A function is a rule that associates or maps


one element in set A, called a domain, to one element in
set B, and called the range.

The above observation forms the basis of the proposed publickey cryptosystem.

y=f(x)

A. Proposed Public-Key-Cryptosystem

f
x

Given y and a trapdoor (secret), x can be


computed easily.

Bob

f -1
Set A

Set B

Domain

Range

(d, y, n)

Select p,q
n = p*q
(n) = (p-1)*(q-1)
Select r where 1 r < (n)
Select e where 1<e< (n)
&gcd (e, (n)) =1
Select d where ed r mod(n)
Select b where b<n
bd y mod n

Public

Fig. 1.2 a function as rule mapping a domain to a range


An invertible function is a function that associates each
element in the range with exactly one element in the
domain.
One-Way Function: A one-way function (OWF) is a
function that satisfies the following two properties:
f is easy to compute. In other words, given x, y =
f(x) can be easily computed.
f -1 is difficult to compute. In other words, given
y, it is computationally infeasible to calculate x
= f -1(y). A trapdoor one-way function (TOWF)
is a one-way function with a third property:

Key Generation

Alice

Private

(d, y, n)

(e, b, r, n)

C: Ciphertext
P

CT = (Pd* y) mod n

P= Ce mod n
P = (P)1/r
P = P/b

Plaintext

P
Plaintext

Figure 2.1 represents the proposed public-key cryptosystem

2012 International Conference on Recent Advances in Computing and Software Systems

239

Figure 2.1 represents the proposed public-key cryptosystem. It


starts with the selection of two large prime numbers p and q.
Then we calculate n=pq which is the modulus and (n).It uses
a remainder r, two exponents e and d and a base value b.
Suppose P is the plaintext and C is the cipher text. Alice uses
C= (Pd*y) mod n to create the cipher text C from plaintext P;
Bob uses three steps to retrieve the plaintext back as P=Ce
mod n, P= (P)1/r, P=P/b.
Now if Eve wants to get the plaintext from the cipher text she
first needs to find out the base value b. After brute force attack
if Eve retrieves the base b, he still needs to find out e which is
again dependent on the remainder r. As we keep r as secret it
will be difficult for Eve to guess r.
We select d such that
e*d r mod (n)
=> (e*d) / (n) = (q, r), where q is the quotient &
r is the remainder
=> e*d = q* (n) + r

(3)

From (3) we can say that


(bd)e = bq* (n) + r

C. Encryption
The encryption procedure uses exponentiation and
multiplication. Anyone can send a message to Bob using his
public keys (d, y, n).The size of the plaintext must be much
smaller than n, which means if the size of the plaintext is
larger than modulus n, it should be divided into blocks.
Encryption_Pseudocode
{
CT (PTd* y) mod n
}
where PT=plaintext, CT=cipher text
D. Decryption
The decryption procedure uses exponentiation as well as
division. Bob can decrypt the cipher text received using the
decryption algorithm. It consists of three steps. To get the
cipher text back the cipher text must be much smaller than the
modulus n.
Decryption_Pseudocode
{
PT CTe mod n
PT (PT)1/r
PT PT/b
}

From (2) we can say that


bq* (n) + r br mod n,
B. Key Generation
The key generation first starts with the selection of two large
prime numbers p, q. Then we calculate the modulus n and
(n).We select r and e both to be less than (n) and also assure
that gcd of (e, n) =1.Next we select d such that the product of e
and d gives the remainder r with respect to the modulus
(n).Last we select the base b to be less than n. We then raise b
to the power d and calculate the remainder y with respect to
the modulus n. Bob then announces the tuple (d, y, n) as the
public key and the tuple (e, b, r, n) as the private key.
Key_Generation_Pseudocode
{
Select p & q two large prime numbers.
n p*q
(n) (p-1)*(q-1)
Select r such that 1 r < (n)
Select e such that 1<e< (n) & gcd (e, (n)) =1
Select d such that ed r mod (n)
Select b such that b<n
bd y mod n
Public (d, y, n)
Private (e, b, r, n)
}

240

III. PROOF
In the proposed cryptosystem the decryption expression Ce
mod n can be verified to be plaintext P, through substitutions:
Ce mod n= (Pd *y)e mod n= (Pd*bd)e mod n= (P*b)r mod n
Therefore, after the first step of the decryption
P= (P*b)r mod n
Now substituting P in Step2 of decryption:
P= (P)1/r mod n = (P*b)r *1/r mod n= (P*b) mod n
After substituting P in Step3 of decryption:
P=P/b= (P*b)/b mod n=P mod n
IV. CONCLUSION AND REMARKS
The working of the algorithm is based on the careful selection
of the parameters specified. Values of p and q should be large
enough to make the modulus n very large. Values of b and r
should be such that br is much smaller than n. To ensure br is
smaller than n, b should be much smaller than n and r should
be much smaller than (n). We will get the plaintext back
only when the plaintext, Pr multiplied with br does not exceed
the modulus n. Therefore, b and r should be carefully selected
to get the plaintext back after decryption. To launch an attack

2012 International Conference on Recent Advances in Computing and Software Systems

the attacker has to find out the base b and remainder r, so if we


change the values of b and r each time of encipherment it will
be much more tough to launch an attack. In future we would
like to test the resistance of the proposed public key
cryptosystem against various cryptographic attacks.

V. REFERENCES
[1]
[2]
[3]
[4]
[5]

Forouzan and Mukhopadhyay, Cryptography and Network Security, 2nd


edition.Mc Graw Hill.
Thomas Koshy, Elementary Number Theory with Applications, Elsevier.
Alfred J. Menezes, Paul C. van Oorschot and Scott A. Vanstone,
Handbook of Applied Cryptography, CRC Press, 1996
RSA Laboratories, PKCS#1 v2.1: RSA Cryptography Standard, June
2002, http://www.rsa.com/rsalabs/node.asp?id=2125
http://en.wikipedia.org/wiki/Public-key_cryptography

2012 International Conference on Recent Advances in Computing and Software Systems

241

You might also like