Wednesday, September 10, 2014

How to Encrypt And Decrypt Files with GPG?

Linux: How To Encrypt And Decrypt Files With A Password in gpg?


T

o encrypt and decrypt files with a password,  you canuse gpg command. This is an encryption  tool for Linux/UNIX like operating system.

gnupg

GnuPG stands for GNU Privacy Guard.

Encrypting a file in linux

To encrypt a single file, 
$ gpg -c somefilename
It will prompt for password:
Enter passphrase:
Repeat passphrase:
This will create a somefilename.gpg file. Where,
  • -c : Encrypt with symmetric cipher using a passphrase. The default symmetric cipher used is CAST5, but may be chosen with the --cipher-algo option. This option may be combined with --sign (for a signed and symmetrically encrypted message), --encrypt (for a message that may be decrypted via a secret key or a passphrase), or --sign and --encrypt together (for a signed message that may be decrypted via a secret key or a passphrase).
Note that if you ever forgot your password (passphrase), you cannot recover the data as it use very strong encryption.

How to Decrypt a file

To decrypt file use the gpg command as follow:
$ gpg somefilename.gpg
gpg: CAST5 encrypted data
Enter passphrase:

Monday, September 8, 2014

How to check either string is present or not in TCL programming?



How to check either string is present or not in TCL programming?


Below is example to search xyz in long string let's say http://xyz.com/home/index.html
set variable_name http://xyz.com/home/index.html
if {![lsearch -regexp $variable_name xyz ]} {
puts " Not found"
exit 1
 } else {
puts "OK"
}

How to keep SSH session alive in PUTTY?



How to keep SSH session alive in putty utility?

Open putty-->goto Connection--> look for "Seconds between keepalives (write 30 seconds)

Enjoy !!!