This is the sixth day of my participation in the August Text Challenge.More challenges in August

1.1.4 How to Set a Secure Password

  • Don’t use common passwords. Don’t use common passwords like type 123456.
  • You are advised to use different passwords for different application software to avoid an application database being removed from the database and all application passwords collapsing.
  • You can add the registration time, registration place, and application features when setting the password. For example, tianjin123456 indicates that the application is registered in Tianjin.

1.2 the ASCII coding

ASCII (American Standard Code for Information Interchange) is a computer coding system based on the Latin alphabet used to display modern English and other Western European languages. It is the most common single-byte coding system today and is equivalent to the international standard ISO/IEC 646.

The sample code

Create the Maven project encrypt-Decrypt

Add a POM file

<dependencies> <dependency> <groupId> Commons -io</groupId> <artifactId> Commons -io</artifactId> <version>2.6</version> </dependency> </dependencies>Copy the code

Create com classes. Atguigu. ASCII. AsciiDemo

Characters are converted to ASCII codes

/** * AsciiDemo * * @Author: Q * @CreateTime: 2021-03-17 * @Description: */ public class AsciiDemo { public static void main(String[] args) { char a = 'A'; int b = a; // Print ASCII system.out.println (b); }}Copy the code

1.3 Caesar encryption

1.3.1 Encryption in ancient China

Here’s a quick story about how ancient people encrypted and decrypted it:

In 683, Emperor Zhongzong ascended the throne. Later, Wu Zetian deposed Emperor Zhongzong of the Tang Dynasty and appointed her fourth son, Li Dan, as emperor.

Pei Yan, Xu Jingye and Luo Binwang are very dissatisfied with this. Xu Jingye gathered a hundred thousand soldiers in Yangzhou, Jiangsu province. Pei Yan does inside answer, want to pass secret information for its with uncovering means. After because someone tells against, Pei Yan is arrested, the secret letter that did not send falls in wu Zetian’s hand. The secret letter had only the word “green goose” on it, which puzzled the courtiers.

Wu Zetian cracked the secret of “green goose” : “green” word opened to be “December”, and “goose” word opened to be “I and”. The secret letter means to let Xu Jingye, Luo Bin king and other troops in December, Pei Yan in the interior. “Green goose” deciphering, Pei Yan was killed. Then Wu zetian sent her troops to defeat Xu Jingye and King Luobin.

1.3.2 Foreign Encryption

In cryptography, the Caesar cipher is one of the simplest and most well-known encryption techniques.

The Caesar code was first used by Gaius Julius Caesar, the military commander of ancient Rome, to transmit encrypted messages in the army, so it is called the Caesar code. This is a displacement encryption method, only for the displacement of 26 letters encryption, simple rules, easy to crack. Here is the comparison of displacement 1:

Moving the plaintext alphabet back 1 bit, A becomes B, B becomes C… Z becomes A. Similarly, if we move the plaintext alphabet back 3 bits:

Then A becomes D, B becomes E… Z becomes C.

The alphabet can move up to 25 bits. It is possible to move the plaintext alphabet of a Caesar cipher backward or forward. It is usually expressed as moving backward. If you want to move forward by 1 bit, it is the same as moving back by 25 bits.

It is a substitution encryption technique in which all the letters in the plaintext are replaced with ciphertext by a fixed number of alphabetical shifts backwards (or forwards).

For example, when the offset is 3, all the letters A will be replaced with D, B with E, and so on.

This encryption method is named after Caesar, who used it to communicate with his generals.

Caesar ciphers are often used as a step in other, more complex encryption methods.