I fucking hate taxes! I have not declared them, I am afraid to be punished by the stupid government, the offices only open when I am at work, is always a lot of fucking money, I am underpaid, unhappy with life and carreer, everything sucks! Fuck taxes, fuck every form of control, I hate it!, […]

Today I ran into this basic problem. A quick search on google gave me the answer, I tested it, it worked, and the rest is history. Here is the code. let plainText = “Hello World!”; console.log(“Plaint text = ” + plainText); // Encoding to base64 let base64 = new Buffer(plainText).toString(‘base64’); console.log(“Encoded to base64 = ” […]

This post has been moved to a new blog, click here: https://hexphoto.wordpress.com/2017/05/24/how-to-mount-sony-alpha-a6000-inside-your-car/

Here I have created a class that does it in two different ways, the first one is, when you create the key, and the other is when you are given the key, valid key sizes are 128, 192, and 256 for AES algorithm. There is some steps to follow before executing the code provied, if […]

With JSON files of around 900 lines, this option is very useful to have an organized view. I highly recommend to check the links, there is a lot of things you can do with Visual Studio Code, my version is 1.10.2, and the following shortcuts are working. Ctrl+K Ctrl+0 Fold (collapse) all regions Ctrl+K Ctrl+J […]

Here is how to do it, the simplest way, to generate the base64 string. No complications with KeyStores or things like that. I must say that I found this code in several places over the Internet. When I tried to run it I had some exceptions, I solved them, at the time of this writing, […]

Today I had to do this for my job (hash some info) and I think is a good opportunity to share the knowledge. Here is the code, you can simply copy it and paste it in a file called SHA256Hmac.js and run it. let crypto; try {     crypto = require(‘crypto’); } catch (err) { […]

If you like cryptography you might know that sometimes you have a byte array which you wish to convert to hexadecimal string. In java, to this day, I haven’t found yet a native class that does it, I’ve spent several minutes on the Internet looking for something like the Base64 class. Turns out Apache commons […]

Recently I was wondering how to generate a private key in Java for a personal project. I found out how to generate the actual key pair with RSA algorithm. Here is the java code for that, a simple class that you can run to check how things work. import java.security.KeyPairGenerator; import java.security.KeyPair; import java.security.PrivateKey; import […]