diff --git a/assets/img/Zesc.jpg b/assets/img/Zesc.jpg new file mode 100644 index 0000000..49c165b Binary files /dev/null and b/assets/img/Zesc.jpg differ diff --git a/opsec/steganography/Circumvention.drawio b/opsec/steganography/Circumvention.drawio new file mode 100644 index 0000000..2fbed54 --- /dev/null +++ b/opsec/steganography/Circumvention.drawio @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opsec/steganography/Steganography.drawio b/opsec/steganography/Steganography.drawio new file mode 100644 index 0000000..4e59138 --- /dev/null +++ b/opsec/steganography/Steganography.drawio @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opsec/steganography/circumvention.jpg b/opsec/steganography/circumvention.jpg new file mode 100644 index 0000000..162eac2 Binary files /dev/null and b/opsec/steganography/circumvention.jpg differ diff --git a/opsec/steganography/comparison.jpg b/opsec/steganography/comparison.jpg new file mode 100644 index 0000000..56be0d4 Binary files /dev/null and b/opsec/steganography/comparison.jpg differ diff --git a/opsec/steganography/index.html b/opsec/steganography/index.html new file mode 100644 index 0000000..6ff724a --- /dev/null +++ b/opsec/steganography/index.html @@ -0,0 +1,141 @@ + + + + + + + + + + + Other sources of Plausible Deniability: Steganography + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ Previous Page

Zesc - 2024-08-30

+

Other sources of Plausible Deniability: Steganography

+ +

Steganography is the craft of hiding messages. It is a close relative of cryptography, but where cryptography strives to conceal the contents of a messages, steganography attempts to conceal its presence. Therefore steganography helps avoiding suspicion and providing deniability.

+
+
+
+
+ +
+
+
+
+

The important difference between the two fields is adherence to Kerckhoffs's principle: the assumption that an algorithm must be publicly known to guarantee that it has no flaws or backdoors. (This is the reason why you should only use open source crypto software and never roll your own crypto.)
Steganography does the opposite by relying on security by obscurity: the method by which you hid your data must be kept secret.

+ +

That means that whilst complementary to cryptography, steganography on itself is less secure than the mathematically provable security provided by cryptography. Think of it as tucking away your valuables in secret location versus putting them into a sturdy safe. The safe may draw immediate attention by burglars, but provides reliable resistance to attacks, whilst it is up to chance whether they find your hidden stash.

+ +

Then why use steganography at all?

+

In military science, there is the concept of the Integrated Survivability Onion — in short, the idea that they can't kill you if they don't hit you, that they can't hit you if they don't shoot at you and that they can't shoot at you if they don't see you. The same thing applies to every good digital defense-in-depth approach. Using steganography can't harm you, but it shouldn't be all your rely on. In our example, a hidden safe is better than either option on its own.

+ +

Here a quick overview of using steganography alone, cryptography alone and combining the two:

+ +
+ +

The main strength of steganography is that steganography can conceal metadata to some extent. Metadata (i.e. data about data and communications) is the primary way that state actors identify targets for closer scrutiny. When you can become guilty by association, your primary concern may be communicating in public without anyone noticing and not the confidentiality of your communications. (In fact, many cryptographic schemes attest the identity of the sender via signatures, which you should avoid when looking for plausible deniability in case of compromise.)

+ +

However, some form of communication event must always occur, so steganography exploits various side-channels in order to embed additional concealed data. In order to thwart analysis of metadata, communicate through one or multiple uninvolved third party dead-drops, preferably such with broad distribution (i.e. popular websites, like social media or message/image boards).

+ +

When relying on such third parties, steganography can help circumventing censors. If an adversary controls a critical link in the network and blocks all communications they can't inspect, you need to conceal your encrypted communications inside of superficially innocuous traffic. An example of this would be a corporate email server which denies all attachments it can not scan for malware.

+ +
+ +

The major downside of steganography however is the need to tell your target audience how to find your hidden messages. Where cryptography allows for secure key negotiation even in plain sight of adversaries, informing a party you don't already have a secure communication channel with might be impossible.

+ + +
+
+
+
+ + + +
+
+
+
+

Nihilism

+

+ Until there is Nothing left. + +

+
+ +
+

My Links

+

+ + RSS Feed
Matrix Chat
+ +

+
+ +
+

About Zesc

+

Donate XMR: 46BYryUrGcrcRbXFFgTZMYKg8UVY1FpwVfNfHc4GxCXMFwvVtg2YDuf8x8pF36yh4XFWpC3V2WrDgZh7w46MYZEQ3zJQhhR


Contact (Matrix): @zesc:matrix.org

+
+ +
+ +
+
+ + + + + + + diff --git a/opsec/steghide/apod20240824.jpg b/opsec/steghide/apod20240824.jpg new file mode 100644 index 0000000..2f58bfa Binary files /dev/null and b/opsec/steghide/apod20240824.jpg differ diff --git a/opsec/steghide/apollo11.jpg b/opsec/steghide/apollo11.jpg new file mode 100644 index 0000000..8354c02 Binary files /dev/null and b/opsec/steghide/apollo11.jpg differ diff --git a/opsec/steghide/difference.jpg b/opsec/steghide/difference.jpg new file mode 100644 index 0000000..7dea286 Binary files /dev/null and b/opsec/steghide/difference.jpg differ diff --git a/opsec/steghide/index.html b/opsec/steghide/index.html new file mode 100644 index 0000000..3441628 --- /dev/null +++ b/opsec/steghide/index.html @@ -0,0 +1,186 @@ + + + + + + + + + + + Hiding files in images with steghide + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Hiding files in images with steghide

+ Previous Page

Zesc - 2024-08-30

+

steghide is a mature GPL-licensed CLI tool for hiding arbitrary data inside of of image files (and some archaic audio formats). Its official web presence is located at https://steghide.sourceforge.net/. it conceals data inside a larger coverfile in a way that is indistinguishable to first-order statistical analysis. This means there is are anomalies in the file histogram, making most pictures innocuous without an original to compare to.

+
+
+
+
+ +
+
+
+
+ +

Basic Use

+ +

steghide is ubiquitously mirrored in various repositories and package managers. You can also find a clone of the sourceforge repository on GitHub. If you use APT, simply install it with

+
# apt install steghide
+ +

steghide uses subcommands, and the three most important ones are info, embed and extract which will be explained in sequence. For this tutorial, we are going to use the Astronomy Picture of the Day of 2024-08-24, a beautiful image of the anti-twilight arch:

+
+

Our example file to hide is going to be Bitcoin: A Peer-to-Peer Electronic Cash System, the original paper by Satoshi Nakamoto.

+ +

As mentioned above, the cover image must be larger than the file you wish to embed, as a rule of thumb your coverfile should be 20 times larger. (Hint: you can split larger files with tools like tar or 7z into smaller fragments to embed into a whole collection of cover files.) We can check how many bytes steghide can embed by using steghide info file. In our case, it tells us that it can embed 232 KB and asks whether an attempt should be made at reading embed data without extracting. As there is nothing embedded yet, we decline with n.

+ +
"apod20240824.jpg":
+  format: jpeg
+  capacity: 232.6 KB
+Try to get information about embedded data ? (y/n) 
+
+ +

The PDF is only 180 KB, so it fits. Next, we use steghide embed -cf coverfile -ef embedfile -sf destination and get asked for a passphrase (make sure to remember it or safe it in a password manager). After re-entering the passphrase (you can set it beforehand with the -p option) it will write the processed file to the specified destination. You can also leave out the -sf option, in which case it defaults to overwriting the coverfile. Look at it and try to find a visual difference to the original:

+
+

It's completely lost in the visual noise. As an experiment, let's try taking the difference of both images with a program like GIMP. This is what it looks like:

+
+ +

A difference of zero means a fully black pixel. Try zooming in and you'll see that only a few pixels are slightly lighter than black. These are the pixels that contain parts of your embedded file in their least significant bits.

+ +
WARNING: changing the output file in anyway will make the embedded file irretrievable. This is especially important for every form of lossy compression!
+ +

Now let's try to extract the file we've just hid. For this, use steghide embed -sf input

. This will prompt you for the passphrase. Enter it, and the contents will be extracted into the working directory. In our case we will be asked whether we want to overwrite the file with the same name that already exists. (You can suppress this warning with -f or by specifying an alternative output destination with -xf. Here, I used the later so we can confirm the files to be identical with md5sum: +
d56d71ecadf2137be09d8b1d35c6c042  bitcoin.pdf
+d56d71ecadf2137be09d8b1d35c6c042  output.pdf
+ +

And they are! This concludes the basic introduction to steghide. Some advanced details follow below, but in most cases, reading the well-written man page suffices.

+ + +
+
+
+
+ + +
+
+
+
+

Advanced Use

+

Common Pitfalls

+

There are a couple of things you shouldn't do with steghide. Here a quick overview:

+
    +
  1. Use strong passwords: Always a given. The password to steghide can be brute-forced like every other password. stegseek can brute force 14 million passwords in under 2 seconds.

  2. +
  3. Use original images: Known images can be easily double-checked against your cover files. If for example the Monero icon on your website is different to that included in the official press kit, that's suspicious, defeating the purpose of steganography. Make sure to only use this with originals only you are in possession of - in a pinch, adding an in-picture caption, resizing it, etc. offers plausible deniability, as different image editing programs are notoriously variant in handling pixel-level details.

  4. +
  5. Avoid images with little detail: Images without pixel-level visual noise (e.g. diagrams, images of text, etc.) will have less hiding space, and become visible deteriorated when files are embedded. For demonstration purposes, compare this map with its original, then look at their difference. The embedded file was a mere 4286 B in size, yet these two files differ by 6693 B in size! (The password is left as a brute-forcing exercise for the reader.)

  6. +
  7. Avoid format conversions: Even "lossless" conversions from one image format to another tend to be non-reversible, making it impossible to retrieve the hidden data. Remember that many popular websites compress all images uploaded to them to save on bandwidth, making them unsuitable for our purposes.

  8. +
+ +

Changing the encryption

+

As you've seen, steghide needs a passphrase to embed and extract data. (Note: using an empty passphrase can lead to issues extracting.) This passphrase is used to both encrypt your file before embedding and to seed the PRNG by which it selects pixel positions for embedding data. By default, it uses AES-128. You should not rely on steghide for securing your data cryptographically (see the introduction to steganography), and when in doubt you can separately encrypt the file before embedding, but you may still want to change the used algorithm. For this, simply use -e algorithm mode. You can list all available modes with steghide encinfo. So as example, to embed our previous picture using AES-256 in cipher feedback mode, you would use this:

+ +
$ steghide embed -cf apod20240824.jpg -ef bitcoin.pdf -e rijandael-256 cfb 
+ +

Using steghide recursively

+

Since steghide works on arbitrary binary data, you can embed steghide's output into another picture, provided the size is sufficient. The 4.8 MB picture below contains a 260 KB waveform audio file which in turns contains 2.7 KB UTF-8 encoded text file. (The passphrase is moon for both.)

+
+ + +

+

+
+
+
+
+ + + + + +
+
+
+
+

Nihilism

+

+ Until there is Nothing left. + +

+
+ +
+

My Links

+

+ + RSS Feed
Matrix Chat
+ +

+
+ +
+

About Zesc

+

Donate XMR: 46BYryUrGcrcRbXFFgTZMYKg8UVY1FpwVfNfHc4GxCXMFwvVtg2YDuf8x8pF36yh4XFWpC3V2WrDgZh7w46MYZEQ3zJQhhR


Contact (Matrix): @zesc:matrix.org

+
+ +
+ +
+
+ + + + + + + diff --git a/opsec/steghide/map.jpg b/opsec/steghide/map.jpg new file mode 100644 index 0000000..bc34cea Binary files /dev/null and b/opsec/steghide/map.jpg differ diff --git a/opsec/steghide/map_diff.jpg b/opsec/steghide/map_diff.jpg new file mode 100644 index 0000000..dc56de9 Binary files /dev/null and b/opsec/steghide/map_diff.jpg differ diff --git a/opsec/steghide/map_orig.jpg b/opsec/steghide/map_orig.jpg new file mode 100644 index 0000000..7b9f3e7 Binary files /dev/null and b/opsec/steghide/map_orig.jpg differ diff --git a/opsec/steghide/output1.jpg b/opsec/steghide/output1.jpg new file mode 100644 index 0000000..25a6b57 Binary files /dev/null and b/opsec/steghide/output1.jpg differ