{"id":263,"date":"2021-09-21T08:24:15","date_gmt":"2021-09-21T07:24:15","guid":{"rendered":"https:\/\/www.cybersecuritynotepad.com\/?p=263"},"modified":"2021-09-21T08:28:27","modified_gmt":"2021-09-21T07:28:27","slug":"ssd-usb-drive-encryption-linux","status":"publish","type":"post","link":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/","title":{"rendered":"SSD \/ USB Drive Encryption &#8211; Linux"},"content":{"rendered":"\n<p>In this post, I will briefly cover encryption of SSD drives, removable hard drives and USB drives. Depending on your objectives you may need to tweak certain options to achieve stronger protection, if required.  <\/p>\n\n\n\n<p>Before starting the process, it is necessary to connect the drive of your choice to your Linux system. If the drive is already connected first identify the drive that is to be encrypted. The following command will provide the details you need:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo fdisk -l<\/pre>\n\n\n\n<p>Assuming that the drive that is to be encrypted is \/dev\/sdb, if no encryption is present, you can set it up using the command below. This command will also wipe your drive therefore make sure that the correct drive is selected:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cryptsetup -y -v luksFormat \/dev\/sdb<\/pre>\n\n\n\n<p>Then select &#8220;YES&#8221; and enter credentials you would like to use for encryption.<\/p>\n\n\n\n<p>To decrypt the drive the following command is used. &#8220;drive-label&#8221; is any label you would like to use when mounting the drive e.g. mydrive2:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cryptsetup luksOpen \/dev\/sdb drive-label<\/pre>\n\n\n\n<p>You can also wipe the drive to remove any unwanted data &#8220;\/dev\/zero&#8221; is not random. Another option is \/dev\/urandom which is better when wiping LUKS keyslots. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo dd if=\/dev\/zero of=\/dev\/mapper\/mydrive2 status=progress<\/pre>\n\n\n\n<p>Next step is creating the filesystem on the drive: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mkfs.ext4 \/dev\/mapper\/mydrive2<\/pre>\n\n\n\n<p>To close the drive:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cryptsetup luksClose \/dev\/mapper\/mydrive2<\/pre>\n\n\n\n<p>To open the drive:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cryptsetup luksOpen \/dev\/sdb mydrive2\nsudo mount \/dev\/mapper\/mydrive2 \/mnt\/mydrive2<\/pre>\n\n\n\n<p>To unmount and close the drive:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo unmount \/mnt\/mydrive2\nsudo cryptsetup luksClose \/dev\/mapper\/mydrive2<\/pre>\n\n\n\n<p>For more information, please refer to the LUKS manual available on any Linux system.  One important thing to remember is creating a suitable backup of LUKS headers for encrypted drives. In case these headers get damaged either accidentally or when updating the operating system, the encrypted data may become unrecoverable.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I will briefly cover encryption of SSD drives, removable hard drives and USB drives. Depending on your objectives you may need to tweak certain options to achieve stronger protection, if required. Before starting the process, it is necessary to connect the drive of your choice to your Linux system. If the drive&hellip; <a class=\"more-link\" href=\"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/\">Continue reading <span class=\"screen-reader-text\">SSD \/ USB Drive Encryption &#8211; Linux<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[25,6,24,27,26],"class_list":["post-263","post","type-post","status-publish","format-standard","hentry","category-references_command_line","tag-encryption","tag-linux","tag-luks","tag-ssd","tag-usb","entry"],"yoast_head":"<title>SSD \/ USB Drive Encryption - Linux - Cyber Security Notepad<\/title>\n<meta name=\"description\" content=\"cyber security, cyber security notepad, Windows, Linux, 0-day research, exploit development, tools, references, cyber, security, information\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SSD \/ USB Drive Encryption - Linux - Cyber Security Notepad\" \/>\n<meta property=\"og:description\" content=\"cyber security, cyber security notepad, Windows, Linux, 0-day research, exploit development, tools, references, cyber, security, information\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Cyber Security Notepad\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-21T07:24:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-21T07:28:27+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/\"},\"author\":\"cybersecuritynotepad\",\"headline\":\"SSD \\\/ USB Drive Encryption &#8211; Linux\",\"datePublished\":\"2021-09-21T07:24:15+00:00\",\"dateModified\":\"2021-09-21T07:28:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/\"},\"wordCount\":263,\"keywords\":[\"encryption\",\"Linux\",\"LUKS\",\"SSD\",\"USB\"],\"articleSection\":[\"References\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/\",\"url\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/\",\"name\":\"SSD \\\/ USB Drive Encryption - Linux - Cyber Security Notepad\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/#website\"},\"datePublished\":\"2021-09-21T07:24:15+00:00\",\"dateModified\":\"2021-09-21T07:28:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/#\\\/schema\\\/person\\\/7fd460a876c44ee288cb37cb33e1ed5e\"},\"description\":\"cyber security, cyber security notepad, Windows, Linux, 0-day research, exploit development, tools, references, cyber, security, information\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/index.php\\\/2021\\\/09\\\/21\\\/ssd-usb-drive-encryption-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSD \\\/ USB Drive Encryption &#8211; Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/\",\"name\":\"Cyber Security Notepad\",\"description\":\"Cyber and Information Security News, Trends, Guides and Tools\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cybersecuritynotepad.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>","yoast_head_json":{"title":"SSD \/ USB Drive Encryption - Linux - Cyber Security Notepad","description":"cyber security, cyber security notepad, Windows, Linux, 0-day research, exploit development, tools, references, cyber, security, information","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_GB","og_type":"article","og_title":"SSD \/ USB Drive Encryption - Linux - Cyber Security Notepad","og_description":"cyber security, cyber security notepad, Windows, Linux, 0-day research, exploit development, tools, references, cyber, security, information","og_url":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/","og_site_name":"Cyber Security Notepad","article_published_time":"2021-09-21T07:24:15+00:00","article_modified_time":"2021-09-21T07:28:27+00:00","author":"admin","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/#article","isPartOf":{"@id":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/"},"author":"cybersecuritynotepad","headline":"SSD \/ USB Drive Encryption &#8211; Linux","datePublished":"2021-09-21T07:24:15+00:00","dateModified":"2021-09-21T07:28:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/"},"wordCount":263,"keywords":["encryption","Linux","LUKS","SSD","USB"],"articleSection":["References"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/","url":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/","name":"SSD \/ USB Drive Encryption - Linux - Cyber Security Notepad","isPartOf":{"@id":"https:\/\/www.cybersecuritynotepad.com\/#website"},"datePublished":"2021-09-21T07:24:15+00:00","dateModified":"2021-09-21T07:28:27+00:00","author":{"@id":"https:\/\/www.cybersecuritynotepad.com\/#\/schema\/person\/7fd460a876c44ee288cb37cb33e1ed5e"},"description":"cyber security, cyber security notepad, Windows, Linux, 0-day research, exploit development, tools, references, cyber, security, information","breadcrumb":{"@id":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.cybersecuritynotepad.com\/index.php\/2021\/09\/21\/ssd-usb-drive-encryption-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cybersecuritynotepad.com\/"},{"@type":"ListItem","position":2,"name":"SSD \/ USB Drive Encryption &#8211; Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.cybersecuritynotepad.com\/#website","url":"https:\/\/www.cybersecuritynotepad.com\/","name":"Cyber Security Notepad","description":"Cyber and Information Security News, Trends, Guides and Tools","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cybersecuritynotepad.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/posts\/263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/comments?post=263"}],"version-history":[{"count":3,"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/posts\/263\/revisions"}],"predecessor-version":[{"id":267,"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/posts\/263\/revisions\/267"}],"wp:attachment":[{"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/media?parent=263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/categories?post=263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cybersecuritynotepad.com\/index.php\/wp-json\/wp\/v2\/tags?post=263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}