Posts

Showing posts with the label Cryptography

Node.js - MD5, SHA-1, SHA-256, SHA-384, SHA-512 Example

Image
What does Hashing mean? A secure password hash is an encrypted sequence of characters obtained after applying certain algorithms and manipulations on utilizer-provided passwords, which are generally very impotent and facile to conjecture. Please remember that once this password hash is engendered and stored in the database, you can not convert it back to the pristine password. Using MD5 algorithm The MD5 message-digest algorithm is a widely used hash function engendering a 128-bit hash value. Albeit MD5 was initially designed to be utilized as a cryptographic hash function, it has been found to suffer from extensive susceptibilities. It can still be utilized as a checksum to verify data integrity, but only against unintentional corruption. It remains felicitous for other non-cryptographic purposes, for example for determining the partition for a particular key in a partitioned database. Node.js MD5 Example: var crypto = require( 'crypto' ); var data = "Your Password"

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

Kotlin MD5, SHA-1, SHA-256, SHA-384, SHA-512, and PBKDF2 Hashing Example

Image
What does Hashing mean? A secure password hash is an encrypted sequence of characters obtained after applying certain algorithms and manipulations on utilizer-provided passwords, which are generally very impotent and facile to conjecture. Please remember that once this password hash is engendered and stored in the database, you can not convert it back to the pristine password. Using MD5 algorithm The MD5 message-digest algorithm is a widely used hash function engendering a 128-bit hash value. Albeit MD5 was initially designed to be utilized as a cryptographic hash function, it has been found to suffer from extensive susceptibilities. It can still be utilized as a checksum to verify data integrity, but only against unintentional corruption. It remains felicitous for other non-cryptographic purposes, for example for determining the partition for a particular key in a partitioned database. MD5 Example: import java.lang.StringBuilder import java.nio.charset.StandardCharsets import java.