Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    ๐Ÿ”‘ Encryption vs ๐Ÿ”’ Hashing

    Blogs
    encryption hashing security programming cryptography
    7
    13
    2384
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • b6
      b6 last edited by b6

      :key: Encryption vs :shield: Hashing


      Introduction

      Encryption and Hashing. The two main terms in cryptogrphy. We know both techniques are using to hide actual data in programming. But there are few major differences between.

      Let's see the very basic concept & difference between Encryption and Hashing.


      Encryption

      Encryption is the process of using an algorithm to transform information to make it unreadable for unauthorized users. - Techopedia

      Encryption is a kind of algorithm to transform the data to unreadable format or specific format that can't be read by anyone else.

      It looks like,

      Before Encrypt - Hi, How are you?
      After Encrypt - dahj963hqd92h2hr2f hf9vb3y9863b52c3569

      Only the system or specific user can decrypt the data.

      The lenth of encrypted data depends on the actual data lenth. If you input small data, the encrypted data also will be smaller. If you input huge data, the encrypted data will be larger.

      The encryption machanism has two type of keys.

      1. Public Key - Open key that use to encrypt data.
      2. Private Key - Secret key that use to decrypt the encrypted data.

      encryption machanism


      Hashing

      Hashing is also working like encryption. But Hash doesn't have keys like public & private.

      And Also, Hashing's output doesn't depends on the input size. Its' output will be a fixed size of string.

      It means, imagine the hashing function hash() returns 32 characters output, The output will not be increased or decresed.

      echo hash('a')
      0cc175b9c0f1b6a831c399e269772661  //32 chars output
      
      echo hash('Data encryption translates data into another form, or code, so that only people with access to a secret key (formally called a decryption key) or password can read it. Encrypted data is commonly referred to as ciphertext, while unencrypted data is called plaintext. Currently, encryption is one of the most popular and effective data security methods used by organizations. Two main types of data encryption exist - asymmetric encryption, also known as public-key encryption, and symmetric encryption')
      fc2a2d702e1af572e4fe4dddb31ccc90  //32 chars output
      

      hash function

      The another thing is, We can't reverse the hash. It means we can hash a data. But we can't get data again from hash.


      Encryption Hashing
      Output length not Fixed Fixed Output length
      Can retrieve data again Can't retrieve data again
      Use as a trusted data Use as a trusted and unique identifier

      When use Encryption and Hashing ?


      Use cases of hashing,

      • Store Passwords in Database.
      • Compare file hashes for check damage (Check Sum).
      • Compare data for difference or changes.

      Use case of encryption,

      • Store sensitive data.
      • Transfer data over network / internet.
      • Make dedicated file system / extensions.

      Thank you!

      With :hearts: B6.

      1 Reply Last reply Reply Quote 6
      • lkdev
        lkdev last edited by

        Good explanation, keep posting good luck

        b6 1 Reply Last reply Reply Quote 0
        • lahirunc
          lahirunc last edited by

          Nice Work! Keep up!

          b6 1 Reply Last reply Reply Quote 0
          • root
            root Linux Help last edited by

            good work bro.. lankadevelopers are making a huge IT world in Sri Lanka

            b6 1 Reply Last reply Reply Quote 0
            • b6
              b6 @lkdev last edited by

              @lkdev Thank you for your support :)

              1 Reply Last reply Reply Quote 0
              • b6
                b6 @lahirunc last edited by

                @lahirunc Thanks bro

                1 Reply Last reply Reply Quote 0
                • b6
                  b6 @root last edited by

                  @root Yes. The srilanka's stack overflow :)

                  1 Reply Last reply Reply Quote 3
                  • dev_lak
                    dev_lak last edited by dev_lak

                    nice explanation bro...

                    b6 1 Reply Last reply Reply Quote 1
                    • b6
                      b6 @dev_lak last edited by

                      @dev_lak Thank you bro

                      1 Reply Last reply Reply Quote 0
                      • MoRaL
                        MoRaL last edited by

                        cool explanation broh ๐ŸŽฉ

                        b6 1 Reply Last reply Reply Quote 0
                        • b6
                          b6 @MoRaL last edited by

                          @MoRaL Thank you bro

                          1 Reply Last reply Reply Quote 0
                          • imadusanka
                            imadusanka last edited by

                            Good post

                            b6 1 Reply Last reply Reply Quote 0
                            • b6
                              b6 @imadusanka last edited by

                              @isuru2014 Thx Bro

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post

                              0
                              Online

                              3.7k
                              Users

                              1.3k
                              Topics

                              5.3k
                              Posts

                              • Privacy
                              • Terms & Conditions
                              • Donate

                              © Copyrights and All right reserved Lanka Developers Community

                              Powered by Axis Technologies (PVT) Ltd

                              Made with in Sri Lanka

                              | |