Skip to main content

Featured

The STEM Revolution: From Classrooms to Code Camps

  In Nepal, the "STEM Revolution" represents a significant departure from memorization and a move toward experiential, hands-on science, technology, engineering, and math education. This approach recognizes that although traditional classrooms are fundamental, they frequently fail to provide students with the critical thinking and problem-solving abilities that the modern world requires.  It is motivated by a shared understanding that in order for Nepal's youth to prosper in the digital era, they must not only comprehend ideas but also learn how to use them creatively to address pressing issues. Making education relevant and enabling students to be creators of technology rather than merely consumers are the goals of this revolution. Dynamic, unofficial learning settings like maker spaces, robotics clubs, and programming camps are at the core of this movement. These programs, which are frequently run by neighborhood tech companies and non-profits, act as dynamic centers...

Hashing

 Hashing is the process which converts a simple plain text into a text which is not the same text entered. You can think like that after hashing the text is now with mix letters which does not make any sense. Hashing is an algorithm that is used for keeping password database so that if a hacker hacks your database than hacker cannot know the password because it is not password it is hash.

There are many hashing algorithm like md-5, sha256, RSA etc. Hashing algorithm is an encryption algorithm. In different programming language we can convert a word or phrase into hash so that we can keep the word or phrase secret. You know that password is very important because much people sign in in different website. If there password is strong than while converting into simple text it can take lots of time to know. Which means that your password is very secure and strong. 

In different programming the way of writing the program for converting a text into hash may be different but at last we get the output same. For example: 

In python if make a program to convert the phrase 'Hello world' into md5 hash it will give result 3e25960a79dbc69b674cd4ec67a72c62. And If you wish to try in php language it also going to give you same result because word is same 'Hello world'. The syntax comparison is given below:

In Python

import hashlib

result = hashlib.md5(b'Hello world')

print(result.hexdigest())


Output: 3e25960a79dbc69b674cd4ec67a72c62


In Php

<?php

$str = "Hello world";

$a = "3e25960a79dbc69b674cd4ec67a72c62";

echo md5($str);

?>

Output:

3e25960a79dbc69b674cd4ec67a72c62


Here both the result is same. But in case of bcrypt means blowfish algorithm every time you run the program you are going to get new hash for same word or phrase. For example if the run the program that converts "New things to know" into hash and show the hash as output than the first result might show '$2b$12$/LHdmOpjLcK0cOI4KFIJees8YB0K7IJdkTreRQfLlAnSP1VUNgJma', another ''$2b$12$AeUG/6cJL8gepOTphLazBud/Os4tKdZVRrovGscn2qHMqLJhWW.kq".

In python the program is made like this. Code:

import bcrypt

phrase = b"New things to know"

hashed = bcrypt.hashpw(phrase, bcrypt.gensalt())

print(hashed.decode('utf-8'))


Just I want to tell is that it returns different hash for same phrase if it run many times.


Comments

Popular Posts