Encryption
Encryption is the process of converting plain text to cipher text.
The encryption process takes place using an encryption key. The encryption key is used by the encryption algorithm to generate the cipher text.
The encryption key is provided by the end user.
Symmetric-key encryption
Symmetric-key encryption is the process of encrypting and decrypting data with the same key. It's a useful method for protecting bulk data while it's in transit, but it can also be used to protect data that never leaves a server. This private key is then encrypted using the public key and sent along with the message. The recipient will use their private key to decrypt the private key and use that to decrypt the message.
Symmetric-key cryptography is often referred to as AES for Advanced Encryption Standard, which was established by NIST in 2001 and made into a standard in 2002. NIST required that the algorithm had no more than 128 bits of security strength, be fast enough for software implementation (that means it can't require extensive processing power), have no more than 10 rounds, and have 64-bit block sizes. It also had to support 128-, 192-, 256-, 512-, or 1024-bit keys as well as provide both hardware/software implementations for portability across different platforms.
Asymmetric-key encryption or Public Key Cryptography
Asymmetric-key encryption, or public key cryptography, is a method of encrypting and decrypting data using two different keys. One key is used to encrypt the data and another to decrypt it. The most important aspect of this encryption algorithm is that both keys are mathematically related but the private key cannot be derived from the public key by performing any kind of mathematical operation.
A user can distribute his/her public key so that anyone who wants to send them encrypted data can do so. The private key is kept secret by its owner so that only they can decrypt messages encrypted by their public key.
Hash Functions
Hash functions are one-way algorithms that take a message of any length and return a fixed-size string. The hash function is used for password storage, for example. The PHP Hash() function can be used on numbers, strings, and arrays to generate hashes.
Summary
Encryption and decryption are essential elements of modern data security. They can be used to secure login information, prevent tampering with messages, and plenty more. Plenty of programming languages have built-in encryption algorithms that developers can leverage for these purposes.
In PHP, there are a number of different ways you can encrypt and decrypt data. Several encryption algorithms—such as Rijndael or AES—are symmetric key algorithms. These only require the use of one secret key to both encrypt and decrypt data. Another category of encryption algorithms is asymmetric keys—like RSA—which uses two distinct but mathematically related keys to encrypt and decrypt data.
PHP also has hash functions, which are useful for comparing two different strings without revealing the encrypted version of either string. MD5 is an example for Hash functions used in PHP
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.