[NetPGP] Encrypt and Decrypt File - SpartanCoin 1.2

[SpartanCoin Xjail - Working Revision 2.0]

SpartanCoin Master Space

1. Generate RSA key:

$ netpgpkeys --generate-key

...

Enter passphrase for 91b92b92dd05e33b:

Repeat passphrase for 91b92b92dd05e33b:

...

$ netpgpkeys --list-keys --home ~/.gnupg/91b92b92dd05e33b

1 key found

...

$ cd ~/.gnupg/91b92b92dd05e33b

$ mv pubring.gpg secring.gpg ../

$ rmdir 91b92b92dd05e33b or:

$ ln -s .gnupg/91b92b92dd05e33b

/pubring.gpg

$ ln -s .gnupg/91b92b92dd05e33b

/secring.gpg

2. Encrypt File:

$ netpgp --encrypt hello.cpp # This will generate hello.cpp.gpg or:

$ netpgp --encrypt --output=xyz.netpgp

hello.cpp

$ rm hello.cpp

3. Decrypt File:

$ netpgp --decrypt hello.cpp.gpg # This will generate hello.cpp or:

$ netpgp --decrypt xyz.netpgp # This will print content to screen. or:

$ netpgp --decrypt --output=ff.txt xyz.netpgp

$ cat hello.cpp or:

$ cat ff.txt #########################################################################

4. sign

$ netpgp --sign < hello.cpp | netpgp --encrypt > xyz.netpgp

$ netpgp --decrypt < xyz.netpgp | netpgp --cat