Posts

List of Top NoSQL Databases-2023

Image
NoSQL , which stands for “ not only SQL ,” is an approach to database design that can accommodate a wide variety of data models, including key-value, document, columnar, and graph formats. NoSQL  is an alternative to traditional relational databases in which data is placed in tables and data schema is meticulously designed before the database is built.  NoSQL  databases are especially utilizable for working with large sets of distributed data.  NoSQL Features & Capabilities  Performance  Availability  Multi-Model  Concurrency  Security  Scalability  Data Model Flexibility  Deployment Model Flexibility  Today, we will see a  list of top NoSQL databases. MongoDB MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. Documents consist of key-value pairs which are the basic unit of data in MongoDB. Collections contain sets of documents and functions which is the equivalent of relati

Python - MD5 , SHA-1, SHA-256, & SHA-512 Hashing

Image
Hashing is the transformation of any given key or string of characters into a new value. The new value is typically a short, fixed-length key that represents the original string and makes it simpler to find or use. Please note that once this hash is created and saved to the database, it cannot be changed back to your original password. MD5 hash in Python MD5 (Message-Digest algorithm) is one of the most popular hash functions. It produces a hash value of 128 bits. Originally, MD5 was designed to be a cryptographic hash function. However, it has a large number of known vulnerabilities. MD5 can still be used for checksums to check the integrity of data, but only against accidental corruption. It is still suitable for non-cryptographic uses, such as determining the partition of a specific key in a distributed database. Example:  Use hashlib.md5() method to generate an MD5 hash value from a String.   # Python3 code to demonstrate the MD5 import hashlib   # initializing the string str = &q

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

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"

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

Go Language - Program to find the duplicate words in a string

Image
Hello everyone, today we need to find out the duplicate words present in the string and print those words. Example 1: Program to find the duplicate words in a given string //Program to find the duplicate words in a string package main import ( "fmt" "strings" ) // Main function func main() { str := "hola hello hi hola good sleep hello hi night morning" //Converts the string into lowercase strl := strings.ToLower(str) //Split the string into words words := strings.Split(strl, " " ) fmt.Println( "Duplicate words in a given string are, \n" ) for i := 0 ; i < len(words); i++ { count := 1 for j := i + 1 ; j < len(words); j++ { if words[i] == words[j] { count++ //Set words[j] to 0 to avoid printing visited word words[j] = "0" } } //Displays the duplicate word if count is greater tha