Cryptography synthesis tool
Foreword
Our network information security experiment. . . We want to find a variety of algorithm source code, in fact, This is not difficult, that is a bit time-consuming. I integrated the code found on the Internet, with Java made a cryptographic tool . Which contains a symmetric encryption algorithm DES, AES, IDEA, public encryption algorithm RSA, ECC, hash algorithm MD5, SHA1, CRC32, and RSA, DSA, ECDSA digital signature verification examples.
Do all day, a little sore skull, liver test report and write the whole of a half days , part of 10 people live were all over my liver.
All encryption algorithms are hard to find I can run. . Then modify the call interface, and finally with Base64 encoding the results shown as String string, I can guarantee that each algorithm can correct encryption and decryption , but can not guarantee the correctness of the algorithm itself .
Since only a small tool used in the experiment, so many exceptions and not humane place no treatment, there is a need and seeking.
git URLs
https://github.com/szluyu99/Encryption-And-Decryption-By-Yu
Project structure
Project preview
This was before I saw a small demo, feel the air show, when they brought in the main interface show it.
Click disrupted ~
symmetric encryption in, DES, DES2 represent two DES algorithm implemented source, AES, IDEA empathy.
Public encryption inside, RSA, RSA2 represent two-source RSA implementation. ECC Similarly, but ECC3 seemed to have forgotten to do, regardless.
Hash algorithm contains the MD5, SHA1, CRC32. withSalt
Express salt .
Digital signature not being placed on the graphical interface, but the project contains a demo that can be run.
Crack the hash table, then later adopted rainbowcrack and MD5Crack3.0, UltraCrackingMachine and several ready-made software, easy to use, there is no place go up. .
After the organic'll finish this software. (I always think if each of the software)
Add the following String and byte [] system conversion of the notes.
String and byte [] Huzhuan
By using Java byte array embodiment of the learning and String mutual conversion, the conversion may be needed in many cases, such as IO operation, generating an encrypted hash code and the like.
Generally, unless special needs, do not convert them to each other, they represent the different data, specialized services for different purposes, usually String
on behalf of a text string , byte[]
for binary data .
In the past two days to do network security, cryptography experiments, wrote a small tool that integrates the Internet to find symmetric encryption, public encryption, hashing algorithms. But many online algorithm is by byte[]
encode and decode, is not convenient for us to show, it can be translated into strings by Base64 to show.
By String
class conversion
With String.getBytes () method to convert a string byte array, by the constructor String to convert a byte array into String
Note: This method uses the platform's default character set
public class StringByteArrayExamples
{
public static void main(String[] args)
{
// String
String string = "hello world";
// String 转 byte[]
byte[] bytes = string.getBytes();
// byte[] 转 String
String s = new String(bytes);
System.out.println("Decoded String : " + s);
}
}
hello world
By Base64
Huzhuan [jdk-8]
Base64
Is a binary data encoded manner as UTF-8
, and UTF-16
is the same as the data encoded text, so if you need to encode binary data into text data, it Base64
can achieve such a demand.
From Java 8 may use Base64
this class.
import java.util.Base64;
public class StringByteArrayExamples
{
public static void main(String[] args)
{
// byte[]
byte[] bytes = "hello world".getBytes();
// byte[] 转 String
String encoded = Base64.getEncoder().encodeToString(bytes);
// String 转 byte[]
byte[] decoded = Base64.getDecoder().decode(encoded);
System.out.println( new String(decoded) );
}
}
hello world