I want to create a master key where I XOR 3 random keys (generated with crypto.randomBytes). I am not sure how to make this work in Javascript. randomBytes returns a Buffer. I’m not sure if I have to do a .toString() on it or just perform the XOR as a Buffer? Answer This should do: