If you don’t have the Plugin Manager for Notepad++, you can still install NppCrypt and SecurePad by dropping their DLL files in C:/Program Files/Notepad++/plugins. The files you’ll need are nppcrypt.dll and SecurePad.dll.
Once installed, the NppCrypt option will appear in the Plugins menu. To encrypt, simply highlight the section of text you want to encrypt, and select ‘Plugins’ – ‘NppCrypt’ – ‘Encrypt‘. This will open the ‘nppcrypt::encryption‘ window, in which the user can select the encryption type, algorithm and mode to use – you wouldn’t need to change any of these, as the default (Rijndael with 256-bit key in GCM mode) is sufficiently for strong encryption.
By default NppCrypt will use Rijndael256 in GCM mode. A number of much weaker options are supported.
With the password and encryption parameters set, the plaintext will be replaced with the ciphertext and the metadata required for decryption.
To decrypt the text, simply highlight the ciphertext, select ‘Plugins’ – ‘NppCrypt’ – ‘Decrypt‘ and enter the password.
The other plugin, SecurePad, requires less knowledge to use, but it doesn’t allow the user to decide the cipher or parameters to use. To encrypt a text, select ‘Plugins’ – ‘SecurePad’ – ‘Encrypt Document‘. The ciphertext appears like:
Encryption here is actually handled by Bruce Schneier’s implementation of the Blowfish cipher (blowfish.h) that accompanied the Applied Cryptography book. The implementation here supports three modes: ECB, CBC and CFB. I went through the code trying to determine which of these is used by SecurePad.
Looking at the code in PluginDefinition.cpp, it appears that SecurePad does use the cipher in ECB mode – this isn’t good because the same plaintext blocks encrypted with the same key would produce the same ciphertext, making it easier to spot patterns and potentially infer the original plaintext. Here is the code I was looking at:
I have forked the project, and modified the above section of code to use the cipher in CFB mode. The project must be recompiled to apply the fix in the plugin.