Professional Documents
Culture Documents
Nis 2
Nis 2
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.
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.
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.
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.
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.
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.
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.
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;
class User{
public:
string name;
long int privateKey,genKey,secretKey,recivedKey;
bool isLogined;
User(){
privateKey = NULL;
genKey = NULL;
secretKey = NULL;
recivedKey = NULL;
isLogined =NULL;
}
};
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
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)