Cryptography basics (course study notes)

  • Basic terminology
    • Plaintext: Plaintext is the message that needs to be sent;
    • Ciphertext: Ciphertext is garbled information obtained by encrypting plaintext;
    • Key: The key is the input parameter that needs to be selected in the encryption and decryption operation.
  • Classical code
    • Spartan code stick device

    • Caesar Code
    • Encryption method
      • Replace password: Disturb the alphabetical order of the input plaintext without changing the value of the plaintext alphabet.
      • Substitution password: Replace letters in plain text without changing the order.
      • Steganography: protect messages by hiding their presence
        • Invisible ink
        • Character format changes
        • Image distortion
      • Tibetan poems
      • Implicit grammar
      • Word analysis
  • Mechanical code
    • Encryption and decryption machine
      • Enigma

        • composition
          • keyboard
          • monitor
          • Rotor (3)
        • Disadvantages of ENIGMA (one rotor): Type 6 letters in a row, the rotor rotates once, the encryption device returns to the original form, and the encryption is repeated with the original encryption method.
        • ENIGMA (two rotors): repeat only after encrypting 6 * 6 = 36 letters.
        • ENIGMA (three rotors): need to encrypt 26 * 26 * 26 = 17576 letters before repeating.
      • Enigma code buster-"bomb" decoder
      • New type of decoding machine "Giant" electronic computer
  • Symmetric cipher
    • Encryption method
    • classification
      • Block cipher
        • Working method: divide the plain text into fixed length groups

        • Block cipher algorithm
          • DES algorithm
            • Defects and deficiencies
              • The design of DES may contain traps, the design principle of S box has not been announced so far
              • The key capacity is too small: 56 bits is unlikely to provide sufficient security
            • Improve
              • 3DES algorithm: call the DES algorithm three times in a row
              • low efficiency
          • AES algorithm
            • Basic requirements: Supports three different lengths of key input, 128, 192, and 256 bits, and can encrypt 128-bit input plaintext each time.
          • Operating mode
            • ECB (easiest)
            • CBC
            • CFB
            • OFB
      • Stream cipher
        • Features
          • Simple to implement
          • Easy hardware implementation
          • Fast encryption and decryption
        • Encryption process

    • Password distribution for symmetric passwords
      • Since both parties in communication use the same key, if there are malicious users in both parties in communication, the security of the above password cannot be guaranteed, that is, there is a key security problem.
      • Every time a pair of users use a symmetric encryption algorithm, they need to use a unique key that no one else knows. This will cause the number of keys owned by both the sending and receiving parties to grow geometrically, causing users to store the management key The burden of the key.
      • Symmetric password cannot be used for digital signature
    • insufficient
      • Key update, management and distribution issues
      • Cannot be applied to digital signatures
  • Public key password
    • Idea: The keys held by the two parties of communication are different, that is, the input parameters required for encryption and decryption are different.
    • Important characteristics: Knowing the cryptographic algorithm and encryption key, it is not feasible to calculate the decryption key.
    • Encryption and decryption process

    • E.g
      • RSA public key algorithm
        • It is based on Euler's theorem in elementary number theory and is based on the difficult problem of large integer factorization.
    • Using the public key idea, everyone can query the public key information of the recipient of the message, which avoids the shortage of storing the session key for each pair of communicating parties.
    • Users can also use their private keys to encrypt information and decrypt with the corresponding public key, so as to achieve the effect of digital signature.
    • Application scenario
      • Network protocols include SSL / TLS, IPsec / IKE, SSH, S / MIME, POP / IMAP, DNSsec, SBGP ...
      • In real life: online shopping, online banking, smart card, email, digital signature
  • Classical ciphers, mechanical ciphers, and symmetric ciphers all use two basic design ideas: substitution and replacement.
  • A cryptographic algorithm using this design idea requires the same encryption and decryption keys

Published 8 original articles · Likes2 · Visits 319

Guess you like

Origin blog.csdn.net/WHD1998/article/details/105547847