Difference between revisions of "SSH encrypt and decrypt"

From ATI public wiki
Jump to: navigation, search
Line 9: Line 9:
 
== How ==
 
== How ==
  
Everyone who uses Secure Shell (SSH) has an easy access to accompanying Secure Shell keys. When You do not have then You generate them.
+
Everyone who uses Secure Shell (SSH) has an easy access to accompanying Secure Shell keys. When You do not have them, then You generate them.
  
All it takes is Linux, MacOS command line or Cygwin shell in Windows. A minute or two and few sips of tea. Done.
+
All it takes is Linux, MacOS command line or Cygwin shell in Windows. A minute or two of Your time and few sips of tea. Done.
  
  
Line 38: Line 38:
 
+----[SHA256]-----+
 
+----[SHA256]-----+
 
</pre>
 
</pre>
 +
 +
The process above creates 2 files <code>id_rsa</code> <code>id_rsa.pub</code> and places them into subfolder <code>.ssh</code> relative to your home directory

Revision as of 18:20, 15 November 2019

Contents

Tutorial on how to encrypt and decrypt small messages using Secure Shell keys

Why?

In case you have to send someone for example a password and sending it over internet in plaintext is out of the question.

How

Everyone who uses Secure Shell (SSH) has an easy access to accompanying Secure Shell keys. When You do not have them, then You generate them.

All it takes is Linux, MacOS command line or Cygwin shell in Windows. A minute or two of Your time and few sips of tea. Done.


One can make simple passwordless RSA key-pair like this:

linux:/home/user> ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:seDs6vDo55WegAZnG/mr8S+sgz2kvJFCc1wAGsHyB2c user@linux
The key's randomart image is:
+---[RSA 4096]----+
|+o..             |
|oo. E            |
|o. + .. .        |
|  o.oo . o       |
|.o=+  o S        |
|.+== . .         |
|oB*.o +          |
|+o=*+* .         |
| o*OBo+          |
+----[SHA256]-----+

The process above creates 2 files id_rsa id_rsa.pub and places them into subfolder .ssh relative to your home directory