<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Security on Geek Cabinet</title>
    <link>https://geekcabi.net/tags/security/</link>
    <description>Recent content in Security on Geek Cabinet</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 27 Aug 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://geekcabi.net/tags/security/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>But What if I HAVE to Encrypt with 7zip?</title>
      <link>https://geekcabi.net/posts/encrypt-with-7z/</link>
      <pubDate>Sun, 27 Aug 2023 00:00:00 +0000</pubDate>
      
      <guid>https://geekcabi.net/posts/encrypt-with-7z/</guid>
      <description>&lt;p&gt;Yes, I know I updated the &lt;a href=&#34;https://geekcabi.net/tools/#file-encryption&#34;&gt;tools page&lt;/a&gt; and now recommend &lt;strong&gt;against&lt;/strong&gt; encrypting with 7zip. But sometimes we have to do things we don&amp;rsquo;t &lt;strong&gt;want&lt;/strong&gt; to do.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Yes, I know I updated the <a href="/tools/#file-encryption">tools page</a> and now recommend <strong>against</strong> encrypting with 7zip. But sometimes we have to do things we don&rsquo;t <strong>want</strong> to do.</p>
<p>Like eat our vegetables. Wait. No, that&rsquo;s actually <strong>good</strong> for you.</p>
<p>Whatever.</p>
<p>You get the idea.</p>
<p>Encrypting a file with 7zip is simple. Use the <code>-p</code> option:</p>
<pre tabindex="0"><code>~$ 7z a archive.7z -pSTRONG_PASSWORD_THAT_IS_REALLY_LONG_HERE! folder/

7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)

Scanning the drive:
1 folder, 4 files, 0 bytes

Creating archive: archive.7z

Items to compress: 5

    
Files read from disk: 0
Archive size: 186 bytes (1 KiB)
Everything is Ok
</code></pre><p>I have always loved 7zip&rsquo;s attempt to make me feel better.</p>
<p>&ldquo;Don&rsquo;t worry. Everything is Ok.&rdquo; :thumbs_up: :grinning_squinting_face:</p>
<blockquote>
<p><strong>Note:</strong>
There is <strong>no space</strong> between the option and the password. That&rsquo;s an oddity with 7z that I just don&rsquo;t see with many other CLI tools.</p>
</blockquote>
<p>You may notice, however, that when you go to list the contents of the archive, the folder and file names are listed <strong>without</strong> prompting for the password!</p>
<pre tabindex="0"><code>~$ 7z l archive.7z                   

7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)

Scanning the drive for archives:
1 file, 186 bytes (1 KiB)

Listing archive: archive.7z

--
Path = archive.7z
Type = 7z
Physical Size = 186
Headers Size = 186
Solid = -
Blocks = 0

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2023-08-23 16:01:10 D....            0            0  folder
2023-08-23 16:01:10 ....A            0            0  folder/bank_info.xlsx
2023-08-23 16:01:10 ....A            0            0  folder/classified.txt
2023-08-23 16:01:10 ....A            0            0  folder/file1.txt
2023-08-23 16:01:10 ....A            0            0  folder/file2.txt
------------------- ----- ------------ ------------  ------------------------
2023-08-23 16:01:10                  0            0  4 files, 1 folders
</code></pre><p>Showing folder and file names without requiring the password is probably not acceptable for encrypted files. (Then again, ideally we wouldn&rsquo;t be using 7zip for encryption, but&hellip;.I already made that point.)</p>
<p>To encrypt the folder and file names, too, we need to use an option that only shows up on the <code>man</code> page of 7zip and not in the CLI help output:</p>
<pre tabindex="0"><code>-mhe=on|off
   7z format only : enables or disables archive header encryption (Default : off)
</code></pre><p>So all of this only works on the 7z format vs traditional zip, etc&hellip;</p>
<p>With this, our example changes to:</p>
<pre tabindex="0"><code>7z a archive.7z -mhe=on -pSTRONG_PASSWORD_THAT_IS_REALLY_LONG_HERE! folder/
</code></pre><p>The output is the same until the file contents are listed:</p>
<pre tabindex="0"><code>7z l archive.7z                           

7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)

Scanning the drive for archives:
1 file, 221 bytes (1 KiB)

Listing archive: archive.7z


Enter password (will not be echoed):
--
Path = archive.7z
Type = 7z
Physical Size = 221
Headers Size = 221
Solid = -
Blocks = 0

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2023-08-23 16:01:10 D....            0            0  folder
2023-08-23 16:01:10 ....A            0            0  folder/bank_info.xlsx
2023-08-23 16:01:10 ....A            0            0  folder/classified.txt
2023-08-23 16:01:10 ....A            0            0  folder/file1.txt
2023-08-23 16:01:10 ....A            0            0  folder/file2.txt
------------------- ----- ------------ ------------  ------------------------
2023-08-23 16:01:10                  0            0  4 files, 1 folders
</code></pre><p>One other thing to note: encrypting a file in this manner will leave the password in your shell history file. I will leave as an exercise to the reader the following search: &ldquo;<a href="https://duckduckgo.com/?q=histcontrol%3Dignorespace" rel="noopener" target="_blank" class="external">HISTCONTROL=ignorespace</a>&rdquo; &#x1f60f;</p>]]></content:encoded>
    </item>
    
    <item>
      <title>Donkeys and KPIs</title>
      <link>https://geekcabi.net/posts/donkeys-and-apis/</link>
      <pubDate>Wed, 13 Apr 2016 09:00:01 +0000</pubDate>
      
      <guid>https://geekcabi.net/posts/donkeys-and-apis/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I originally posted this entry on our family&amp;rsquo;s Wordpress blog, back in 2013. I decided to repost here, since it&amp;rsquo;s still relevant and fits better here anyway&amp;hellip;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Recently, the NSA &lt;a href=&#34;http://www.nsa.gov/public_info/declass/cryptologs.shtml&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; class=&#34;external&#34;&gt;declassified 136 issues&lt;/a&gt; of their monthly internal publication, “Cryptolog”, and released them in PDF versions for public consumption. (&lt;a href=&#34;http://cryptome.org/2013/03/cryptologs/00-cryptolog-index.htm&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; class=&#34;external&#34;&gt;alternate Cryptome archive&lt;/a&gt;) As a geek this was/is very exciting for me.&lt;/p&gt;
&lt;p&gt;Without a great deal of time to read through them, I decided to briefly peruse the edition published the month I was born (Volume V, No 3 – Yes I’m a young whippersnapper) and quickly moved to the article entitled &lt;a href=&#34;https://geekcabi.net/static/files/nsa_cryptolog_40_donkey.pdf&#34;&gt;&amp;ldquo;I had &amp;lsquo;Animal Crackers in my soup,&amp;rsquo; but you’ve got a donkey in your WHAT?&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<blockquote>
<p>I originally posted this entry on our family&rsquo;s Wordpress blog, back in 2013. I decided to repost here, since it&rsquo;s still relevant and fits better here anyway&hellip;</p>
</blockquote>
<p>Recently, the NSA <a href="http://www.nsa.gov/public_info/declass/cryptologs.shtml" rel="noopener" target="_blank" class="external">declassified 136 issues</a> of their monthly internal publication, “Cryptolog”, and released them in PDF versions for public consumption. (<a href="http://cryptome.org/2013/03/cryptologs/00-cryptolog-index.htm" rel="noopener" target="_blank" class="external">alternate Cryptome archive</a>) As a geek this was/is very exciting for me.</p>
<p>Without a great deal of time to read through them, I decided to briefly peruse the edition published the month I was born (Volume V, No 3 – Yes I’m a young whippersnapper) and quickly moved to the article entitled <a href="/static/files/nsa_cryptolog_40_donkey.pdf">&ldquo;I had &lsquo;Animal Crackers in my soup,&rsquo; but you’ve got a donkey in your WHAT?&rdquo;</a>.</p>
<p>What immediately struck me was that we’re still fighting the same mindset: the mindset that we can determine the health/security/etc of a given system simply by looking at a few numbers on a regular basis.</p>
<blockquote>
<p>Many will not discover, until a &ldquo;dead donkey&rdquo; of some sort shows up in their
shop, that statistics, as useful as they can be, are not meant to be the
end-all. Their purpose is to indicate, hint, or suggest that a problem
<!-- raw HTML omitted -->might<!-- raw HTML omitted --> exist. They may highlight a known problem or aid a manager in
distinguishing between a symptom and an underlying cause. At that point the
computerized report has done as much as it can ever do.</p>
</blockquote>
<p>Yet we still try to manage to the numbers. Some things never change, I guess.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
