{"id":636,"date":"2017-03-25T16:28:25","date_gmt":"2017-03-25T16:28:25","guid":{"rendered":"https:\/\/visworlditsolution.wordpress.com\/?p=636"},"modified":"2017-03-25T16:28:25","modified_gmt":"2017-03-25T16:28:25","slug":"how-to-encrypt-file-through-open-ssl-securesocketlayerin-linux-redhat-part-1","status":"publish","type":"post","link":"https:\/\/linux.thingsomething.com\/index.php\/2017\/03\/25\/how-to-encrypt-file-through-open-ssl-securesocketlayerin-linux-redhat-part-1\/","title":{"rendered":"How to encrypt file through open SSL (Secure,Socket,Layer)in Linux RedHat part 1"},"content":{"rendered":"<p>hello guys today we are going to learn how to encrypt file through open ssl method. but \u00a0before \u00a0i enplane some knowledge of\u00a0 open SSL method. open ssl is a file encrypt method.\u00a0 this method in several Version of file encrypting its a very strong method . in\u00a0 this tutorial\u00a0 we will discuss some use full and strong\u00a0 version of encrypt method\u00a0 and we will also learn in our linux machine that\u00a0 how can we apply on our file.<\/p>\n<p>(note- in this tutorial all commands use on redhat linux 5 if you have other version of linux like fedora ,Ubuntu ,kubuntu, or other .Open ssl File encryption method is work on all type of linux .you onlly need to install package according to linux Operating system.<\/p>\n<p><span style=\"color:#008000;\"><strong>Step 1 here we will install openssl package through Yum Server. if you want to know<a style=\"color:#008000;\" href=\"https:\/\/visworlditsolution.wordpress.com\/2016\/12\/26\/what-is-yum-and-how-to-create-in-redhat-linux-server\/\"><span style=\"color:#0000ff;\"> how to configure yum Server in linux redhat<\/span>\u00a0<\/a>\u00a0then click on\u00a0 this link and look.<\/strong><\/span><\/p>\n<pre><strong>[root@localhost exp]# yum install openssl -y<\/strong><\/pre>\n<p>Here before\u00a0 we will learn base64 version open ssl method. in this method we can write encrypted content and also make encrypted file so you just follow me and look with piratical<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color:#008000;\">Step 2 before we will learn how to write encrypt text through \u00a0base64<\/span><\/strong><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@dhcppc16 ~]# echo \"hello this is encrypt method base64 demo\"|openssl enc -base64<\/strong><\/span>\n<span style=\"color:#0000ff;\">aGVsbG8gdGhpcyBpcyBlbmNyeXB0IG1ldGhvZCBiYXNlNjQgZGVtbwo=<\/span><\/pre>\n<p>now if we want to decriypt \u00a0content we will just put our encrypt content mid in&#8221; &#8220;and run command<\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@dhcppc16 ~]# echo \"aGVsbG8gdGhpcyBpcyBlbmNyeXB0IG1ldGhvZCBiYXNlNjQgZGVtbwo=\"|openssl enc -base64 -d \n<\/strong>hello this is encrypt method base64 demo\n<\/span><\/pre>\n<p><strong><span style=\"color:#008000;\">Step 3 we can encrypt any file through this Commands<\/span><\/strong><\/p>\n<pre><strong><span style=\"color:#008000;\">[root@localhost exp]# openssl enc -base64 -in a.txt -out a.enc\n[root@localhost exp]# ls<\/span><\/strong>\n<span style=\"color:#0000ff;\">a.enc  a.txt<\/span>\n<span style=\"color:#008000;\"><strong>[root@localhost exp]# rm -rf a.txt\n[root@localhost exp]# cat a.enc<\/strong><\/span>\n<span style=\"color:#0000ff;\">IGhlbGxvIHRoaXMgaXMgbXkgZGVtbyBmaWxlCg==<\/span><\/pre>\n<p>we can decrypt file through this below Commands<\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# openssl enc -base64 -d -in a.enc -out a.txt\n[root@localhost exp]# ls<\/strong><\/span>\n<span style=\"color:#0000ff;\">a.enc  a.txt<\/span>\n<strong><span style=\"color:#008000;\">[root@localhost exp]# rm -rf a.enc\n[root@localhost exp]# cat a.txt<\/span><\/strong>\n<span style=\"color:#0000ff;\"> hello this is my file encryption base64 demo<\/span><\/pre>\n<p><span style=\"color:#008000;\"><strong>Step 4 Encrypt and decriypt a File or message using AES-256-cvc method<\/strong><\/span><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# echo \"hello this is AES-256-CVC demo\"|openssl enc -aes-256-cbc &gt;a.bat<\/strong><\/span>\n<strong><span style=\"color:#0000ff;\">enter aes-256-cbc encryption password:<span style=\"color:#339966;\"> 12345<\/span>\nVerifying - enter aes-256-cbc encryption password:<span style=\"color:#339966;\">12345<\/span><\/span><\/strong><span style=\"color:#339966;\">\n[root@localhost exp]# ls<\/span>\n<span style=\"color:#008000;\"><span style=\"color:#0000ff;\"><strong>a.bat<\/strong><\/span>\n<strong>[root@localhost exp]# cat a.bat<\/strong><\/span>\n<span style=\"color:#0000ff;\">Salted__Y,@o???a?4???tc(t[?c???$F^?$O???|??[root@localhost exp]#<\/span><\/pre>\n<p>now we will decriypt through below commands<\/p>\n<pre><strong><span style=\"color:#008000;\">[root@localhost exp]# echo \"hello this is AES-256-CVC demo\"|openssl enc -aes-256-cbc -d -in a.bat<\/span>\n<span style=\"color:#0000ff;\">enter aes-256-cbc decryption password:<span style=\"color:#339966;\">12345<\/span><\/span><\/strong>\n<span style=\"color:#0000ff;\">hello this is AES-256-CVC demo<\/span><\/pre>\n<p>here we will learn if we have already any file we want encrypt then we will use below commands<\/p>\n<pre><strong><span style=\"color:#339966;\">[root@localhost exp]# openssl enc -aes-256-cbc -in a.txt -out a.bat<\/span>\n<span style=\"color:#339966;\"><span style=\"color:#0000ff;\">enter aes-256-cbc encryption password<\/span>:<\/span>12345<\/strong>\n<span style=\"color:#0000ff;\">Verifying - enter aes-256-cbc encryption password:<span style=\"color:#008000;\">12345<\/span><\/span>\n<strong><span style=\"color:#008000;\">[root@localhost exp]# ls<\/span><\/strong>\n<span style=\"color:#0000ff;\">a.bat  a.txt<\/span>\n<strong><span style=\"color:#008000;\">[root@localhost exp]# cat a.bat<\/span><\/strong>\n<span style=\"color:#0000ff;\">Salted__?cJ??D^??0?7??6?i???+?#??7??+?z<\/span>\n<span style=\"color:#008000;\"><strong>+^W?[root@localhost exp]#<\/strong><\/span>\n<span style=\"color:#ff0000;\"><strong>we can decrepit file through this Commands<\/strong> <\/span>\n<strong><span style=\"color:#008000;\">[root@localhost exp]# openssl enc -d -aes-256-cbc -in a.bat -out a.txt<\/span><\/strong>\n<span style=\"color:#0000ff;\">enter aes-256-cbc decryption password:<\/span>\n<strong><span style=\"color:#008000;\">[root@localhost exp]# ls<\/span><\/strong>\n<span style=\"color:#0000ff;\">a.bat  a.txt<\/span>\n<strong><span style=\"color:#008000;\">[root@localhost exp]# cat a.txt<\/span><\/strong>\n<span style=\"color:#0000ff;\">hello this is my file demo\n\n<\/span><\/pre>\n<p>if you have any problem in this process so please Comments here i will solve your problem otherwise like share and follow my blog for Linux Networking and IT Solution<\/p>\n<p>thank you<\/p>\n<p>BY Vishnu Sharma<\/p>\n","protected":false},"excerpt":{"rendered":"<p>hello guys today we are going to learn how to encrypt file through open ssl method. but \u00a0before \u00a0i enplane some knowledge of\u00a0 open SSL &hellip; <span class=\"ml-btn\"><a href=\"https:\/\/linux.thingsomething.com\/index.php\/2017\/03\/25\/how-to-encrypt-file-through-open-ssl-securesocketlayerin-linux-redhat-part-1\/\" class=\"more-link\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[8,13],"tags":[36,39,50,55,120,168,204],"class_list":["post-636","post","type-post","status-publish","format-standard","hentry","category-linux-rhel5","category-security","tag-aes-256-cvc","tag-base64","tag-decriypt-file","tag-encrypt-file","tag-how-to-encrypt-file-through-open-ssl-secure","tag-layerin-linux-redhat-part-1","tag-socket"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/636"}],"collection":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/comments?post=636"}],"version-history":[{"count":0,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/636\/revisions"}],"wp:attachment":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/media?parent=636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/categories?post=636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/tags?post=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}