How to generate and use keys using Keyczar?

2.1k Views Asked by At

I am new to network security and trying to make one personal password manager. Definitely now I will have to use encryption and hashing algorithms.

I came across to Keyczar , which provides encryption and decryption algorithms. There I saw following 2 lines which will generate keys.

KeyczarTool create --location=/path/to/keyset --purpose=sign
KeyczarTool create --location=/path/to/keyset --purpose=crypt --name=Test
KeyczarTool create --location=/path/to/keyset --purpose=sign --asymmetric=dsa

Now problem is I am not sure where to execute them, I am using Netbeans.

1

There are 1 best solutions below

1
Gerard Giné On

With these commands you just created the keys. Now you need to write your code that actually uses these keys. In Java, it would be something like:

Crypter crypter = new Crypter("/path/to/your/keys");
String ciphertext = crypter.encrypt("Secret message");

You can find more documentation as well as examples in C++ and Python at https://github.com/google/keyczar/wiki.

UPDATE: Although it's not fully up-to-date, I found this documentation quite useful, a lot deeper than other links you can find out there: https://github.com/google/keyczar/blob/wiki/keyczar05b.pdf