{"id":618,"date":"2017-03-14T16:53:03","date_gmt":"2017-03-14T16:53:03","guid":{"rendered":"https:\/\/visworlditsolution.wordpress.com\/?p=618"},"modified":"2017-03-14T16:53:03","modified_gmt":"2017-03-14T16:53:03","slug":"key-based-security-digital-signature-with-gpg-encryption-in-redhat-linux-server","status":"publish","type":"post","link":"https:\/\/linux.thingsomething.com\/index.php\/2017\/03\/14\/key-based-security-digital-signature-with-gpg-encryption-in-redhat-linux-server\/","title":{"rendered":"Key based security (Digital Signature )with gpg encryption in RedHat Linux Server"},"content":{"rendered":"<p>Hello guys today we will learn how to configure key based Security in RedHat Linux. its a very simple process you just Follow my Simple Steps<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-621\" src=\"https:\/\/visworlditsolution.files.wordpress.com\/2017\/03\/5-free-file-encryption-software-geekomad.jpg\" alt=\"file encrypt\" width=\"278\" height=\"278\" \/><\/p>\n<p><span style=\"color:#ff0000;\"><strong>Step 1 here i Create a.txt File and put something text matter in this file<\/strong><\/span><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# vim a.txt<\/strong><\/span>\n<span style=\"color:#3366ff;\">Hello this is my Digital key signature demo in linux redhat Server\n~\n~\n~\n~<\/span>\n<span style=\"color:#008000;\"><strong>:wq<\/strong><\/span><\/pre>\n<p><span style=\"color:#ff0000;\"><strong>Step 2 then we will encrypt our file below commands<\/strong><\/span><\/p>\n<pre><strong><span style=\"color:#008000;\">[root@localhost exp]# gpg -c a.txt\n<span style=\"color:#0000ff;\">Enter passphrase:<\/span> redhat\n<span style=\"color:#0000ff;\">Repeat passphrase:<\/span> redhat\n<span style=\"color:#ff0000;\">(Note-Here we will remove a.txt file then we have a.txt.gpg file. this is a encrypt file )\n<span style=\"color:#008000;\">[root@localhost ~]# rm -rf a.txt<\/span>\n(Note- now we will open a.txt.gpg file then we will found encrypt data )\n<span style=\"color:#008000;\">[root@localhost ~]# cat a.txt.gpg<\/span>\n<span style=\"color:#0000ff;\">?Q]?q*k?`????@?E?x??[???F??{??6Q??\n<\/span><\/span>\n<\/span><\/strong><\/pre>\n<p><span style=\"color:#ff0000;\"><strong>Step 3 now we can get original file data through below commands<\/strong><\/span><\/p>\n<pre><strong><span style=\"color:#008000;\">[root@localhost ~]# gpg -d a.txt.gpg<\/span><\/strong>\n<span style=\"color:#0000ff;\">gpg: CAST5 encrypted data\nEnter passphrase<span style=\"color:#008000;\">:redhat\n<span style=\"color:#3366ff;\">Hello this is my Digital key signature demo in linux redhat Server\n<span style=\"color:#ff0000;\">(Note- if we want remove encrypt security we will used below Commands)\n<span style=\"color:#339966;\">[root@localhost exp]# gpg a.txt.gpg<\/span>\n<span style=\"color:#3366ff;\">gpg: CAST5 encrypted data\ngpg: encrypted with 1 passphrase\ngpg: WARNING: message was not integrity protected\n<span style=\"color:#008000;\">[root@localhost exp]# ls<\/span>\na.txt  a.txt.gpg\n\n<\/span><\/span><\/span><\/span><\/span><\/pre>\n<p>now suppose we have multi pal file and we want to protract \u00a0all file then we can use digital key.if we will create digital key then again to again no need to create password any time we can apply same password on all file through digital key .<\/p>\n<p><span style=\"color:#ff0000;\"><strong>Step 4 then we will Create Digital key through below Commands<\/strong><\/span><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# gpg --gen-key<\/strong><\/span>\n<span style=\"color:#00ccff;\">gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it\nunder certain conditions. See the file COPYING for details.\nPlease select what kind of key you want:\n   (1) DSA and Elgamal (default)\n   (2) DSA (sign only)\n   (5) RSA (sign only)\nYour selection?<\/span><strong><span style=\"color:#008000;\"> 1 (note- here we will select 1 )<\/span><\/strong>\n<span style=\"color:#00ccff;\">DSA keypair will have 1024 bits.\nELG-E keys may be between 1024 and 4096 bits long.\nWhat keysize do you want? (2048)<strong><span style=\"color:#008000;\"> 2048 (note- here we will put our key bits size)<\/span><\/strong>\nRequested keysize is 2048 bits\nPlease specify how long the key should be valid.\n         0 = key does not expire\n      &lt;n&gt;  = key expires in n days\n      &lt;n&gt;w = key expires in n weeks\n      &lt;n&gt;m = key expires in n months\n      &lt;n&gt;y = key expires in n years\nKey is valid for? (0)<\/span><strong><span style=\"color:#008000;\"> 0 (notes- here we will select 0 becouse we want not Expiry key )<\/span><\/strong>\n<span style=\"color:#00ccff;\">Key does not expire at all\nIs this correct? (y\/N)<\/span> y\n<span style=\"color:#00ccff;\">You need a user ID to identify your key; the software constructs the user ID\nfrom the Real Name, Comment and Email Address in this form:\n    \"Heinrich Heine (Der Dichter) &lt;heinrichh@duesseldorf.de&gt;\"\n<span style=\"color:#008000;\"><strong>Real name:<\/strong><\/span><\/span><span style=\"color:#008000;\"><strong> vishnu sharma        (note- here we will put our name email Address and something Comments)\nEmail address: vlalitsharma@gmailcom  \nComment: this is digital key password<\/strong><\/span>\n<span style=\"color:#00ccff;\">You selected this USER-ID:\n    \"vishnu sharma (this is digital key password) &lt;vlalitsharma@gmailcom&gt;\"\nChange (N)ame, (C)omment, (E)mail or (O)kay\/(Q)uit?<\/span> <span style=\"color:#008000;\"><strong>o (note- here will press o for okay)<\/strong>\n<span style=\"color:#00ccff;\">ou need a Passphrase to protect your secret key. <span style=\"color:#008000;\"><strong>(Note- here we will put our password )<\/strong><\/span>\nWe need to generate a lot of random bytes. It is a good idea to perform\nsome other action (type on the keyboard, move the mouse, utilize the\ndisks) during the prime generation; this gives the random number\ngenerator a better chance to gain enough entropy.\n.++++++++++++++++++++++++++++++.++++++++++..+++++++++++++++.+++++++++++++++++++++++++++disks) during the prime generation; this gives the random number\ngenerator a better chance to gain enough entropy.\n.++++++++++..+++++++++++++++.++++++++++..+++++++++++++++..++++++++++..++++++++++++++++++\ngpg: key 52747DF7 marked as ultimately trusted\npublic and secret key created and signed.\ngpg: checking the trustdb\ngpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model\ngpg: depth: 0  valid:   2  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 2u\npub   1024D\/52747DF7 2017-03-10\n      Key fingerprint = B00B 24CC CA58 9DBB AC29  DFB5 7DBF FE59 5274 7DF7\nuid                  vishnu sharma (this is digital key password) &lt;vlalitsharma@gmailcom&gt;\nsub   2048g\/1C25308A 2017-03-10\n<\/span><\/span><\/pre>\n<p><strong><span style=\"color:#ff0000;\">Step 5 here we will look our file key below Commands<\/span><\/strong><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# gpg --list-key<\/strong><\/span>\n<span style=\"color:#0000ff;\">\/root\/.gnupg\/pubring.gpg\n------------------------\npub   1024D\/5B148026 2017-03-09\nuid                  vishnu sharma (hindiitsolution.com) &lt;vlalitsharma@gmail.com&gt;\nsub   2048g\/7DB30C64 2017-03-0<\/span>9<\/pre>\n<p><span style=\"color:#ff0000;\"><strong>Step 6 now we will provide key on file through below Commands<\/strong><\/span><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# gpg -e -r 'vlalitsharma@gmail.com' a.txt<\/strong><\/span><span style=\"color:#ff0000;\">(Note- here we will gave file name which we want protract)<\/span><\/pre>\n<p><strong><span style=\"color:#ff0000;\">Step 7 we can also broken file in parts through gpg commands\u00a0<\/span><\/strong><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# gpgsplit a.txt.gpg\n[root@localhost exp]# ls<\/strong><\/span>\n<span style=\"color:#3366ff;\">000001-001.pk_enc  000002-018.encrypted_mdc  a.txt  a.txt.gpg<\/span><\/pre>\n<p><strong><span style=\"color:#ff0000;\">Step 6 we can combine our file below Commands\u00a0<\/span><\/strong><\/p>\n<pre><span style=\"color:#008000;\"><strong>[root@localhost exp]# cat 000001-001.pk_enc 000002-018.encrypted_mdc &gt;a.txt\n[root@localhost exp]# ls<\/strong><\/span>\n<span style=\"color:#3366ff;\">000001-001.pk_enc  000002-018.encrypted_mdc  a.txt <\/span><\/pre>\n<p>if you have any problem in this process so please Comments here i will solve your problem<\/p>\n<p>Thank you<\/p>\n<p>by Vishnu Sharma<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello guys today we will learn how to configure key based Security in RedHat Linux. its a very simple process you just Follow my Simple &hellip; <span class=\"ml-btn\"><a href=\"https:\/\/linux.thingsomething.com\/index.php\/2017\/03\/14\/key-based-security-digital-signature-with-gpg-encryption-in-redhat-linux-server\/\" 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":[53,61,167],"class_list":["post-618","post","type-post","status-publish","format-standard","hentry","category-linux-rhel5","category-security","tag-digital-signature","tag-gpg-encryption","tag-key-based-security"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/618"}],"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=618"}],"version-history":[{"count":0,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/618\/revisions"}],"wp:attachment":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/media?parent=618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/categories?post=618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/tags?post=618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}