Is brute forcing the password of an encrypted file legal?
<p>A person I know sent me an encrypted .zip archive and I do not know what data is inside. Is it legal to break the password and open the archive, for example, by using a brute force algorithm? The algorithm may need a long time, but it will reveal the password that was used for the encryption.</p>

<p>The file was sent directly to me and I know that I am meant to be the recipient. I assume that the file was protected by accident.</p>

<p>Would the answer be different if I am not the intended recipient and someone sent me the file by accident?</p>

<p>We both live in Germany.</p>

<p>If you aren’t the intended recipient of the password-protected file:</p>
<ul>
<li><p><a href="https://www.gesetze-im-internet.de/stgb/__202a.html" rel="nofollow noreferrer" title="Strafgesetzbuch (StGB): § 202a Ausspähen von Daten">StGB § 202a</a> makes it illegal to access this file</p>
</li>
<li><p><a href="https://www.gesetze-im-internet.de/stgb/__202c.html" rel="nofollow noreferrer" title="Strafgesetzbuch (StGB): § 202c Vorbereiten des Ausspähens und Abfangens von Daten">StGB § 202c</a> makes it illegal to obtain (e.g., by brute forcing) the password for this file, if you intend to access the file that way (in the sense of § 202a)</p>
<p>(this is the so-called <a href="https://de.wikipedia.org/wiki/Vorbereiten_des_Aussp%C3%A4hens_und_Abfangens_von_Daten" rel="nofollow noreferrer" title="Wikipedia: Vorbereiten des Ausspähens und Abfangens von Daten"><em>hacker paragraph</em></a>)</p>
</li>
</ul>
<p>If you <em>are</em> the intended recipient, this law doesn’t seem to apply, and it shouldn’t be illegal to brute-force the password.</p>

<p>I'm going to go with <strong>yes, it's legal but it's not advised</strong>. But first, allow me to explain:</p>

<p>I believe the contents of the file will be what determines whether or not you break the law. Whilst you may be the intended recipient of this encrypted file, the subject of "how" you access it will not the issue. Yes, you could crack the password on it but if you are only gaining access to an empty folder then you could argue that you have not gained unauthorised access to anything. If the folder happens to contain some confidential information from Area 51 (obviously as an example), then you have accessed data you are not authorised to access.</p>

<p>Now, you <em>could</em> argue that you cracked the password but didn't access any files within the folder. You can't say that just because you have access to something that you definitely used it - after all people have knives in their kitchens but they don't go stabbing people every day.</p>

<p>My opinion is that it's best to ask your friend what exactly the data is within this file. Until then, you risk infringing data protection laws. If you do crack the file, you are riding the edge of a very fine knife.</p>

germany encryption