An extra feature included in Notepad++ that can occasionally be helpful is the hash generator. A hash generator is a function that can create a cryptographic hash from an input.
Tip: A cryptographic hash is a one-way mathematical function. An input is provided to a hashing algorithm and results in the output of a hash. There is no mathematical process you can use yo get the original input back from the hash. The output of the hashing algorithm is always the same if the input is the same, therefore hashes can be used to verify that two inputs were the same.
A common use of hashes is password storage. By only storing a hash of the password, a website or device can compare the hash of the password in the database with the submitted password, if they match the user can sign in.
Hashes are also commonly used for application integrity verification. In this use, the developer of a program publishes the hash of the software. When a user downloads the software, they can check that the hash of the downloaded file matches that of the original. If the hashes match, then the user can be confident that the software they downloaded is legit and safe to use. If the hashes don’t match, it’s possible that the software was corrupted during the download or has been modified, potentially maliciously.
The hash generator in Notepad++ supports two hashing algorithms MD5 and SHA-256. MD5 is an old algorithm which is believed by security experts to be too weak to safely use for sensitive applications such as for passwords or application integrity verification. SHA-256 is a newer and stronger hashing algorithm. Ideally, SHA-256 still shouldn’t be used for passwords, but it is considered strong.
Tip: There are two classes of hashing algorithms, fast and slow. Fast algorithms, like MD5 and SHA-256, are quick to run making them ideal for most purposes. Slow algorithms such as bcrypt and PBKDF2 are specifically designed to be slower and more intensive to run, as they are intended to be used to hash passwords. Slow hashing algorithms are recommended for use in password storage. They significantly increase the time and processing power required by a hacker attempting to brute force a leaked password database, while not applying a significant performance penalty during normal usage.
How to generate a hash in Notepad++
Click “Tools” in the top bar, then select the hashing algorithm you want to use. Next, select how you want to provide the input, you can choose “Generate”, “Generate from files”, and “Generate from selection into clipboard”.
“Generate” allows you to type or paste arbitrary input into a text box and get the output hash.
Tip: You can only enter new lines by pasting them from somewhere else, pressing enter doesn’t work.
“Generate from files” allows you to input a number of files and generate hashes for them.
“Generate from selection into clipboard” allows you to select text within Notepad++ then immediately hash it and put the hash on your clipboard.