Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

 ABSTRACT

In cryptography, encryption is the process of transforming information to make it unreadable to


anyone except those possessing special knowledge, usually referred to as a key. The result of
the process is encrypted information. This research is intended to introduce a new approach for
encryption is the design and implement Kurdish and English languages cipher system. It uses
Kurdish letters and their diacritics for encrypting English messages and vice versa. A pseudo
random generator is used to generate integer numbers to represent each character in Kurdish
language. The same numbers are used again after sorting them to represent the English
characters. The conclusions that are extracted indicate the efficiency of Deffie Hellman
Algorithm according to security and time performance.

The selective application of technology and related procedural safeguard is an important


responsibility for cryptographic algorithm to its electronic data systems. This work specifies the
functionality of Deffie Hellman encryption and decryption to protect the sensitive unclassified
data. Hellman is made available within the context of a total security program consisting of
physical security procedure.

In the absence of generally acknowledged metrics in the public area that could be used to
compute and spell out cryptographic strength, a small operational group agreed to look at the
possibility of developing an approach to cryptographic metrics The purpose of this project is to
report the results of the limited exploratory effort by the above operational group that
investigated the practicality of developing metrics for use in specifying the strength of
cryptographic algorithms. This work is only deals with a small sample of selected symmetric
cipher block encryption algorithms.

The selective application of technological and related procedural safeguard is an important


responsibility of every cryptographic algorithm in providing adequate security to its electronic
data systems. This work specifies Hellman algorithm including its primary component,
cryptographic engines, MODDES, DES, TDES, AES to compare in terms of memory required and
encryption, decryption time.

In today''s epoch, most of the means of secure data and code storage and distribution rely on
using cryptographic Schemes, such as certificates or encryption keys. This research project is
devoted to the security and attack aspects of cryptographic techniques with new symmetric key
algorithm. This algorithm is proposed to achieve the different goals of security i.e., Availability,
Confidentiality and Integrity. We will also discuss the security threats in this algorithm.
Security is a very complex and vast topic. There is such a tool available in markets which easily
crack the conventional cryptographic data. It is necessary to design such an Algorithm which
approaches a different from these algorithms. Hellman is the one of best direction in this
approach.

The proposed system is successfully tested on text. The performance and security provided by
proposed system is better than other secret key algorithm for the message of fixed size. The
main advantage of proposed system is that it is not fully dependent on the key and for the same
plain text it produces different modified secure code .

 INTRODUCTION

Cryptographic algorithms exist to protect information first, by transforming data into a form that
is meaningless to humans, such as a string of zeroes and ones, and, second, by performing
certain manipulations to these transformed data so that even a specially designed machine
cannot recover the original text unless provided with a secret key. The data that has been
transformed can be transmitted electronically, so that even if an eavesdropper manages to read
the message, its true content will remain hidden. The receiving party, however, is equipped with
a secret key, so it can read the original data. This process of hiding data is referred to as
encryption. The process of reversing the transformation is called decryption. Sometimes the
entire process that includes both the encryption and decryption of data is called cipher.
Plaintext refers to data in plain or unencrypted form. Cipher text refers to data in encrypted or
enciphered form. The following are some of the previous studies that introduced new
approaches in encryption or improved old ones. However, Deffie Hellman system uses different
approach and new ideas.
The spectacular growth of the Internet has spawned an increased awareness of and interest in
security issues. Although security has been considered in the design of the basic Internet
protocols, many applications have been and are being designed with minimal attention paid to
issues of confidentiality, authentication, and privacy. As our daily activities become more and
more reliant upon data networks, the importance of an understanding of such security issues
will only increase. Many cryptographic algorithms (e.g., DES, AES) require the establishment of
shared keying material in advance. Manual distribution of keying material is inefficient and
complex. This is where the Diffie-Hellman Key Agreement algorithm is useful. The project is
developed using Visual Studio with C# .Net as programming language. There is only one entity
who will have the access to the system which is user. User first need to login using its login
credentials and then only he/she can access the system. Encryption is the technique of hiding
private or sensitive information within something that appears to be nothing be a usual. If a
person views that cipher text, he or she will have no idea that there is any secret information.
What encryption essentially does is exploit human perception, human senses are not trained to
look for files that have information inside of them. What this system does is, it lets user to send
text as secrete message and gives a key or a password to lock the text, what this key does is, it
encrypts the text, so that even if it is hacked by hacker it will not be able to read the text.
Receiver will need the key to decrypt the hidden text. User then sends the key to the receiver
and then he enters the key or password for decryption of text, he then presses decrypt key to
get secret text from the sender. By using this method, you can double ensure that your secret
message is sent secretly without outside interference of hackers or crackers. If sender sends this
cipher text in public others will not know what is it, and it will be received by receiver. The
system uses online database to store all related information.

 WHAT IS DIFFIE HELLMAN ALGORITHM ?


‘The Diffie–Hellman (DH) Algorithm is a key-exchange protocol that enables two parties
communicating over public channel to establish a mutual secret without it being transmitted
over the Internet. DH enables the two to use a public key to encrypt and decrypt their
conversation or data using symmetric cryptography.

Diffie-Helman is generally explained by two sample parties, Alice and Bob, initiating a dialogue.
Each has a piece of information they want to share, while preserving its secrecy. To do that they
agree on a public piece of benign information that will be mixed with their privileged
information as it travels over an insecure channel. Their secrets are mixed with the public
information, or public key, and as the secrets are exchanged the information they want to share
is commingled with the common secret. As they decipher the other’s message, they can extract
the public information and with knowledge of their own secret, deduce the new information
that was carried along. While seemingly uncomplicated in this method’s description, when long
number strings are used for private and public keys, decryption by an outside party trying to
eavesdrop is mathematically infeasible even with considerable resources.

DH is one of the first practical implementations of asymmetric encryption or public-key


cryptography (PKC). It was published in 1976 by Whitfield Diffie and Martin Hellman. Other
contributors who are credited with developing DH include Ralph Merkle and researchers within
the United Kingdom’s intelligence services (c. 1969).
 Uses of Diffie Hellman Algorithm
Aside from using the algorithm for generating public keys, there are some other places where
DH Algorithm can be used:

Encryption: The Diffie Hellman key exchange algorithm can be used to encrypt; one of the first
schemes to do is ElGamal encryption. One modern example of it is called Integrated Encryption
Scheme, which provides security against chosen plain text and chosen clipboard attacks.

Password Authenticated Agreement: When two parties share a password, a password-


authenticated key agreement can be used to prevent the Man in the middle attack. This key
Agreement can be in the form of Diffie-Hellman. Secure Remote Password Protocol is a good
example that is based on this technique.

Forward Secrecy: Forward secrecy-based protocols can generate new key pairs for each new
session, and they can automatically discard them when the session is finished. In these forward
Secrecy protocols, more often than not, the Diffie Hellman key exchange is used.

 Advantages of the Diffie Hellman Algorithm

 Security: Diffie-Hellman provides a secure method for two parties to establish a shared
secret key over an insecure communication channel. Even if an eavesdropper intercepts
the communication, they cannot easily determine the shared secret key without
knowledge of the private keys.

 Key Exchange: It allows two parties to agree on a secret key without having to exchange
the key directly. This eliminates the need for a secure channel to exchange keys and
reduces the risk of key interception or theft.

 Perfect Forward Secrecy (PFS): Diffie-Hellman provides perfect forward secrecy,


meaning that even if a long-term secret key is compromised in the future, past
communications encrypted using that key remain secure because each session generates
a new shared secret key.
 Scalability: Diffie-Hellman is computationally efficient and scalable, making it suitable for
use in various applications, including secure communication over networks, secure web
browsing (e.g., TLS/SSL), and VPNs.

 Public Key Cryptography: Diffie-Hellman is based on the principles of public-key


cryptography, allowing parties to perform key exchange without needing to share private
keys directly.

 Resistance to Man-in-the-Middle Attacks: Diffie-Hellman key exchange is resistant to


man-in-the-middle attacks when used with authenticated protocols. This ensures that
the parties can detect if an attacker attempts to intercept or modify the communication.

 Disadvantages of the Diffie Hellman Algorithm

 Man-in-the-Middle Attacks (MitM): Diffie-Hellman key exchange is vulnerable to man-


in-the-middle attacks if the communication is not authenticated. Without proper
authentication mechanisms, an attacker could intercept the initial key exchange and
establish separate key exchange sessions with both parties, effectively acting as an
intermediary without their knowledge.

 Potential for Weak Parameters: The security of Diffie-Hellman relies on the choice of
prime numbers and generator values. If weak or poorly chosen parameters are used, it
can weaken the security of the key exchange and make it susceptible to attacks such as
the Logjam attack, which exploits weak parameters to perform a downgrade attack.

 Key Validation: Diffie-Hellman does not inherently provide authentication or key


validation. Parties must ensure the authenticity of the received public keys to prevent
attacks like impersonation or man-in-the-middle attacks.
 Computational Overhead: Diffie-Hellman key exchange involves modular exponentiation
operations, which can be computationally intensive, especially for devices with limited
processing power. This overhead can affect performance, especially in resource-
constrained environments.

 No Authentication: Diffie-Hellman only provides key exchange and does not offer
authentication of the communicating parties by default. Additional mechanisms, such as
digital signatures or certificates, are required to ensure the authenticity of the parties
involved.

 No Key Management: Diffie-Hellman only establishes a shared secret key between two
parties. It does not address key management issues such as key storage, revocation, or
key rotation, which are crucial for long-term security in complex systems.
 C++ Code

#include<bits/stdc++.h>
using namespace std;

long int P=23,G=9; //public keys available

bool exitFlag = true;

class User{
public:
string name;
long int privateKey,genKey,secretKey,recivedKey;
bool isLogined;

User(){
privateKey = NULL;
genKey = NULL;
secretKey = NULL;
recivedKey = NULL;
isLogined =NULL;
}
};

void genrateKey(User *u1,User *u2){


if(u1->privateKey!=NULL){
long int temp = pow(G,u1->privateKey);
u1->genKey = temp % P;
cout<<"Genrated Key = "<<u1->genKey<<endl;
u2->recivedKey = u1->genKey;
cout<<"Genrated Key Is Shared With Other User"<<endl;
}else{
cout<<"Private key is required for this step"<<endl;
}
}

void genrateSecretKey(User *u1){


if(u1->recivedKey!=NULL){
long int temp = pow(u1->recivedKey,u1->privateKey);
u1->secretKey = temp % P;
cout<<"Secret Key Is = "<<u1->secretKey<<endl;
}else{
cout<<"Key Is Not Recived"<<endl;
}
}

void logined(User *u1,User *u2){


if(u1->isLogined){
int choice;
cout<<"Welcome "+u1->name<<endl;
while(u1->isLogined){
cout<<"1.Enter Private Key\n2.Genrate Key\n3.Genrate Secret
Key\n4.Logout"<<endl;
cin>>choice;

switch (choice)
{
case 1:
cout<<"Enter Private Key"<<endl;
cin>>u1->privateKey;
break;

case 2:
genrateKey(u1,u2);
break;

case 3:
genrateSecretKey(u1);
break;

case 4:
u1->isLogined=false;
break;
default:
cout<<"Please Choose Valid Option"<<endl;
break;
}
}
}else{
cout<<"Login Failed"<<endl;
}
}

int main(){
User u1,u2;
int loginChoice;

while(exitFlag){
cout<<"Login As \n1.User 1\n2.User 2\n3.Exit"<<endl;
cin>>loginChoice;

switch (loginChoice)
{
case 1:
u1.isLogined=true;
u1.name="User 1";
logined(&u1,&u2);
break;

case 2:
u2.isLogined=true;
u2.name="User 2";
logined(&u2,&u1);
break;
case 3:
exitFlag = false;
break;
default:
cout<<"Please Select Valid User Login"<<endl;
break;
}
}

return 0;
}
 Code Explanation
This code is a simple implementation of the Diffie-Hellman key exchange protocol in C++. The
protocol allows two users to generate a shared secret key over an insecure channel. Here's a step-
by-step explanation of the code:

1. Class Definition: The `User` class is defined with the following attributes: `name`,
`privateKey`, `genKey`, `secretKey`, `recivedKey`, and `isLogined`. The constructor initializes
these attributes to `NULL`.

2. Key Generation: The `genrateKey` function generates a public key for a user. It takes the
base `G` raised to the power of the user's private key, and then takes the modulus of a prime
number `P`. The generated key is then shared with the other user.

3. Secret Key Generation: The `genrateSecretKey` function generates a secret key for a user. It
takes the received key (which is the other user's generated key) raised to the power of the user's
private key, and then takes the modulus of `P`. This results in the same value for both users,
which is the shared secret key.

4. User Interaction: The `logined` function provides an interface for the logged-in user to
perform actions like entering a private key, generating a key, generating a secret key, or logging
out.

5. Main Function: The `main` function creates two `User` objects and provides an interface for
the user to log in as either `User 1` or `User 2`. Once logged in, the user can perform the actions
provided by the `logined` function.

The output of this code will vary depending on the inputs provided by the user during execution.
However, the final result should be that both users end up with the same secret key if they follow
the protocol correctly. This secret key can then be used for secure communication.
 Output Images
 Conclusion
The Diffie Hellman key Exchange has proved to be a useful key exchange system due to its
advantages. While it is really tough for someone snooping the network to decrypt the data and
get the keys, it is still possible if the numbers generated are not entirely random. Also, the key
exchange system makes it possible to do a man in the middle attack; to avoid it, both parties
should be very careful at the beginning of the exchange.

 References

1. Jakimoski, Kire, "Security Techniques for Data Protection in Cloud Computing."


International Journal of Grid and Distributed Computing 9.1 (2016): 49-56.

2. https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

3. https://en.wikipedia.org/wiki/Polybius_square

4. http://dx.doi.org/10.1016/j.ijleo.2015.11.188.(http://www.sciencedirect.com/science/ar
ticle/pii/S0030402615018215)

5. Encryption. Wellesley college Computer Science Department lecture note retrieved


from : http://cs110.wellesley.edu/lectures/L18-encryption/.Reference Cont.

6. Classical cipher, Transposition ciphers, Retrieved from


http://en.wikipedia.org/wiki/Classical_cipher

7 Transposition ciphers, columnar transposition Retrieved from.


http://en.wikipedia.org/wiki/Transposition_cipher

You might also like