Posts

Showing posts with the label AES

Go Language - Multilevel Data Encryption Using AES and RSA - Implementation

Image
Advanced Encryption Standard(AES) is a symmetric encryption algorithm. AES encryption is used by the U.S. for securing sensitive but unclassified material, so we can say it is enough secure. It allows 128 bit, 192 bit and 256-bit encryption. Symmetric encryption is very fast as compared to asymmetric encryption and are used in systems such as database system.  The RSA algorithm (Rivest-Shamir-Adleman) is a cryptographic algorithm that is used for specific security services or purposes, which enables public-key encryption and is widely used to secure sensitive data, particularly when it is being sent over an insecure network such as the HTTP. A public key is shared publicly, while a private key is secret and must not be shared with anyone. Encryption's primary purpose is to protect against brute force attacks. It is composed of a cipher, the message/data, and a key (the password). With a wide range of free tools available like(Aircrack-ng, John the Ripper, Rainbow Crack, L0phtCrac

Node.js - AES Encryption and Decryption Example

Image
Advanced Encryption Standard is a symmetric encryption algorithm. AES encryption is used by the U.S. for securing sensitive but unclassified material, so we can say it is enough secure. I t allows 128 bit, 192 bit and 256-bit encryption. Symmetric encryption is very fast as compared to asymmetric encryption and are used in systems such as database system. The following illustration highlights how symmetric cryptography works: Example 1: AES 256 Encryption and Decryption //AES 256 Encryption Demo Program // crypto module const crypto = require( "crypto" ); // encrypt the message function encrypt(plainText, securitykey, outputEncoding, iv) { const cipher = crypto. createCipheriv( "aes-256-cbc" , securitykey, iv); return Buffer. concat([cipher.update(plainText), cipher.final()]). toString(outputEncoding); } //AES decryption function decrypt(cipherText, securitykey, outputEncoding, iv) { const cipher = crypto. createDeci

Go Language - AES Encryption And Decryption Example

Image
Advanced Encryption Standard is a symmetric encryption algorithm. AES encryption is used by the U.S. for securing sensitive but unclassified material, so we can say it is enough secure. I t allows 128 bit, 192 bit and 256-bit encryption. Symmetric encryption is very fast as compared to asymmetric encryption and are used in systems such as database system. The following illustration highlights how symmetric cryptography works: Example: package main import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/hex" "fmt" "io" ) func main() { //generate a random 32 byte key key := GenerateRandomKey() //your secret text secret := "This is my password" //encryption encrypted := encrypt(secret, key) fmt.Printf( "encrypted data: %s\n" , encrypted) //decryption decrypted := decrypt(encrypted, key) fmt.Printf( "decrypted data: %s\n" , decry

Kotlin- RSA, AES, 3DES Encryption and Decryption with example

Image
Quick Overview - RSA The RSA algorithm (Rivest-Shamir-Adleman) is a cryptographic algorithm that is used for specific security services or purposes, which enables public-key encryption and is widely used to secure sensitive data, particularly when it is being sent over an insecure network such as the HTTP. A public key is shared publicly, while a private key is secret and must not be shared with anyone. The following illustration highlights how asymmetric cryptography works: Example 1 :  RSA Encryption and Decryption The Cipher Type: RSA/ECB/PKCS1Padding import java.security.spec.PKCS8EncodedKeySpec import javax.crypto.Cipher import java.security.spec.X509EncodedKeySpec import java.io.IOException import java.security.* import java.util.* class RSADemo { var privateKey: PrivateKey var publicKey: PublicKey companion object { // convert String publickey to Key object @Throws (GeneralSecurityException:: class , IOException:: class ) fun loadP