Monday, March 7, 2022

Hashing in Action

Hashing is a cryptographic concept that can be used to validate the integrity of files and store passwords. 

What does it mean?

> Let's say I want to download Eclipse, the popular Java IDE
> I google and find the website from where I can download Eclipse

> But wait, how do I know that this file was not tempered and what is this SHA-512 button
> If you are here, you already know where this is going, let's look at SHA-512

> Now download the file and use OpenSSL tool to find hash of your downloaded file
> cat eclipse-inst-jre-win64.exe | openssl dgst -sha512
> Match the hash

I have OpenSSL tool installed on my system, here are the steps:
https://iamsecurity-tips.blogspot.com/2022/03/install-openssl-on-windows-subsystem.html
https://iamsecurity-tips.blogspot.com/2022/03/install-windows-subsystem-for-linux-wsl2.html

Install OpenSSL on Windows Subsystem for Linux (WSL2)

wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.0.tar.gz

<Check latest version and replace everywhere>

tar -xvf libressl-3.5.0.tar.gz

cd libressl-3.5.0/

./configure

You may receive and error configure: error: no acceptable C compiler found in $PATH 

sudo apt-get install -y build-essential checkinstall

sudo make

sudo make check

sudo make install

sudo ldconfig

<In new Terminal>

openssl version

Install Windows Subsystem for Linux (WSL2)

Pre-requisite: You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11

> Run powershell as administrator

> Run command:

        Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux               

    wsl --install -d Ubuntu 

 > Restart the system, after that find and run Ubuntu and it will ask you to set a user name and password.

    sudo apt update && sudo apt upgrade

  sudo apt install gedit -y


reference: Install WSL | Microsoft Docs