Posts

Showing posts with the label Node.js

Node.js - RSA Encryption And Decryption Example

Image
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: Program to demonstrate RSA encryption and decryption in Node.js, const crypto = require( "crypto" ) // Generating RSA key pairs(public and private key) const { publicKey, privateKey } = crypto.generateKeyPairSync( "rsa" , { // The length of our RSA keys is 3072 bits modulusLength: 3072 , }) //print RSA public key and private key console.log( publicKey.export({ type: "pkcs1" , format: "pem" , }), privateKey.export({ type: "pkcs1" , fo

Node JS: Authentication and Authorization with JWT in Express.js

Image
Hello everyone, Today we will learn how to use the JWT token to handle authentication and authorization in Express. You can download the source code from our GitHub repository, Download link is provided at the end of this post. What is JSON Web Token? JSON Web Tokens (JWT) have been introduced as a self-contained way for securely transmitting information between parties as a JSON object.JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA. When should you use JSON Web Tokens? Authorization:  Once the user is logged in, each subsequent request will include the JWT, allowing the user to access routes, services, and resources that are permitted with that token. Information Exchange:  JSON Web Tokens are a good way of securely transmitting information between parties. Because JWTs can

Node JS mini projects with source code - free download

Image
Project 1: User Management Application - Using Node JS, Angular 10 and MongoDB Technologies used: Node JS Angular 10 MongoDB Express For more information and   download   source code please   click here Project 2: User Management Application - Using Node JS, Vue.js, and MongoDB Technologies used: Node JS Vue.js MongoDB Express For more information and  download   source code please   click here Project 3: User Management Application - Node JS, React JS, and MongoDB Technologies used: Node JS React JS MongoDB Express For more information and   download   source code please   click here Project 4: Node JS: Authentication and Authorization with JWT in Express.js What is JSON Web Token? JSON Web Tokens (JWT) have been introduced as a self-contained way for securely transmitting information between parties as a JSON object.JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact. This information can be verified and trusted because it is digitally signed. JWTs can be signe

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"

Vue.js + Python + MongoDB CRUD example

Image
Hello everyone, today we will learn how to develop a  web application that is a basic User Management Application using MongoDB , Vue.js , Python , and Flask . GitHub repository link is provided at the end of this tutorial. You can download the source code. More Related Topics, React.js + Python + MongoDB CRUD application Python + MongoDB + Vue.js CRUD Application  Angular10 + Python + MongoDB CRUD application Python-Create a CRUD Restful Service API using FLASK and MYSQL Python-Simple CRUD Web App with Python, Flask, and Mysql Python with MongoDB Atlas - CRUD After completing this tutorial what we will build? We will build a full-stack web application that is a basic User Management Application with CRUD features:       • Create User     • List User     • Update User     • Delete User User Interfaces -Retrieve all Users: -Add a User: -Update User: We divided this tutorial into two parts.  PART 1 - Rest APIs Development using Python and Flask PART 2 - UI development using Vue.js PART 1