new stylometry tutorial

This commit is contained in:
nihilist 2024-12-04 13:36:42 +01:00
parent 4410df806b
commit 7b02ee3d58
6 changed files with 270 additions and 2 deletions

View file

@ -145,7 +145,7 @@ No, a tool is not to be blamed for the misuse of a perpetrating third-party.
<p>Stay outside of governmental control by leaving the clearnet for good, and embracing the darknet instead. Just because you are on the darknet doesn't mean you need to do illegal activities either, <b>It is a matter of remaining outside of tyranny first and foremost.</b> If we are indeed heading for this free internet that i envision, it is only a matter of time until operational security eventually becomes common sense, and everyone joins in aswell.</p>
<p>We encourage you to do the same as we are doing. Leaving the clearnet behind, publicly stating to your users that from now on the only way to reach the website is via the Darknet, and eventually <b>completely opting out of the centralisation industry.</b> Instead, in the same way as <a href="xmrbazaar.com">xmrbazaar.com</a> is out there trying to make the use of monero common-sense and normal, <b>we should be making the use of Tor and Darknet as normal as it is to use the Clearnet, without demonizing it.</b> </p>
<p>We encourage you to do the same as we are doing. Leaving the clearnet behind, publicly stating to your users that from now on the only way to reach the website is via the Darknet, and eventually <b>completely opting out of the centralisation industry.</b> Instead, in the same way as <a href="https://xmrbazaar.com">xmrbazaar.com</a> is out there trying to make the use of monero common-sense and normal, <b>we should be making the use of Tor and Darknet as normal as it is to use the Clearnet, without demonizing it.</b> </p>
<p>All that is needed is a little change of habits for you and your users, to learn how to use the <a href="../torbrowsing/index.html">Tor browser</a>, and to learn <a href="../torthroughvpn/index.html">how to use it safely</a>. The Tor network also depends on the community, meaning people like you and me should <a href="../tor/relay/index.html">run Tor nodes</a> to keep the network alive, decentralized and well. <b>I'm sure that if every Tor user was running a Tor node, the entire network would be at least 1000 times bigger.</b> Everyone has a role to play, consider spending a few bucks every month to run a Tor node (on a VPS or not, it can also run from home)</p>

View file

@ -164,7 +164,7 @@
<li><a href="torthroughvpn/index.html">✅ Using Tor Safely: Tor through VPN or VPN through Tor ? </a></li>
<li><a href="phonenumbers/index.html">✅ Phone Numbers are incompatible with Anonymity</a></li>
<li><a href="http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/blog-contributions/issues/43">❌ How to protect against fingerprinting (persona, text, files)</a></li>
<li><a href="http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/blog-contributions/issues/13">❌ Stylography protection (Running a Local LLM and copy pasting messages)</a></li>
<li><a href="stylometry/index.html">✅ Stylometry protection (Running a Local LLM and copy pasting messages)</a></li>
</ol></br>
<p>💻 Clientside - Getting Started (<a href="torthroughvpn/index.html">⚠️ Check if your ISP allows Tor or Not!</a>)</p>

BIN
opsec/stylometry/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
opsec/stylometry/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
opsec/stylometry/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

268
opsec/stylometry/index.html Normal file
View file

@ -0,0 +1,268 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../../../../../assets/img/favicon.png">
<title>Stylometry protection (Running a Local LLM and copy pasting messages)</title>
<!-- Bootstrap core CSS -->
<link href="../../assets/css/bootstrap.css" rel="stylesheet">
<link href="../../assets/css/xt256.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../../assets/css/main.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Static navbar -->
<div class="navbar navbar-inverse-anon navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand-anon" href="\index.html">The Nihilism Blog</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/about.html">About</a></li>
<li><a href="/blog.html">Categories</a></li>
<li><a href="https://blog.nowhere.moe/donate.html">Donate</a></li>
<li><a href="/contact.html">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!-- +++++ Posts Lists +++++ -->
<!-- +++++ First Post +++++ -->
<div id="anon2">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<a href="../index.html">Previous Page</a></br></br><p><img src="../../assets/img/user.png" width="50px" height="50px"> <ba>nihilist@mainpc - 2024-12-04</ba></p>
<h1>Stylometry protection (Running a Local LLM and copy pasting messages) </h1>
<img src="0.png" class="imgRz">
<p>In this tutorial we're going to take a look at how you can run a LLM Locally to rewrite your messages to prevent sylometry fingerprinting (in order to make sure you're not being deanonymized from the way you're typing)</p>
<p><h2><u>OPSEC Recommendations:</u></h2></p>
<ol>
<li><p>Hardware : (Personal Computer / Laptop)</p></li>
<li><p>Host OS: <a href="../linux/index.html">Linux</a></p></li>
<li><p>Hypervisor: <a href="../hypervisorsetup/index.html">libvirtd QEMU/KVM</a></p></li>
<li><p>Virtual Machine: <a href="../hypervisorsetup/index.html">Linux</a> or <a href="../whonixqemuvms/index.html">Whonix</a> or <a href="../tailsqemuvm/index.html">Tails</a> </p></li>
</ol>
</div>
</div><!-- /row -->
</div> <!-- /container -->
</div><!-- /grey -->
<!-- +++++ Second Post +++++ -->
<div id="anon3">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2><b>Why is this important ? </b></h2>
<p>Let's suppose you are a well-known public figure like <b>Captain Blackbeard from one piece</b>, and you are trying to chat anonymously while being on a <a href="../anonsimplex/index.html">SimpleX chatroom</a>, in incognito mode:</p>
<pre><code class="nim">
Nihilist: Hello
Anon: Hi
Nihilist: Who are you ?
Anon: doesn't matter. I want to contribute to the blog.
Nihilist: Ok, what blogpost do you want to contribute on ?
Anon: The Stylometry one please.
</code></pre>
<p>All goes well <b>until you write in such a way that people recognize who you are.</b></p>
<img src="" class="imgRz">
<pre><code class="nim">
Nihilist: Ok, what if i paid you 5 euros for it ?
Anon: Zehahahaha! Oy Matey! you're robbing me here !
Nihilist: Wait, is that you Blackbeard ?!
Anon: Eek!
</code></pre>
<p>We all have unique writing styles, and if you talk (and especially laugh like a one piece character) there are always little language traits, and spelling mistakes, that you may type without even noticing, that may fingerprint you in the long run even if you used all of the correct technology to keep your Anonymity intact.</p>
<p>Which is why we need a LLM that we run locally (as we shouldn't let a third party know our original text), to rewrite our text differently, to prevent from being deanonymized by our writing style.</p>
<p>Shoutout to /u/inadahime for his <a href="http://g66ol3eb5ujdckzqqfmjsbpdjufmjd5nsgdipvxmsh7rckzlhywlzlqd.onion/post/c67d64ec4355ec872373">excellent dread blogpost</a> on this topic, which we're going to showcase.</p>
</div>
</div><!-- /row -->
</div> <!-- /container -->
</div><!-- /white -->
<div id="anon2">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2><b>Local LLM Setup</b></h2> </br> </br>
<p>So from the whonix VM we need to download these 3 components:</p>
<pre><code class="nim">
# At the time of writing, `0.8.16` was the latest version of llamafile. Change this as needed for future releases.
$ torsocks curl -L -o CounterStylometry.llamafile https://github.com/Mozilla-Ocho/llamafile/releases/download/0.8.16/llamafile-0.8.16
$ torsocks curl -L -o zipalign https://github.com/Mozilla-Ocho/llamafile/releases/download/0.8.16/zipalign-0.8.16
$ chmod a+x CounterStylometry.llamafile
$ chmod a+x zipalign
</code></pre>
<p>Next we're going to download the LLM model "gemma-2-2b-it-abliterated-Q6_K.gguf" as it is minimal enough for our needs (weighs 2 GBs), so if the download fails along the way, you can run the comamnd again and it will resume where it stopped, thanks to the "-c" wget argument.</p>
<pre><code class="nim">
$ torsocks wget -c https://huggingface.co/bartowski/gemma-2-2b-it-abliterated-GGUF/resolve/main/gemma-2-2b-it-abliterated-Q6_K.gguf
</code></pre>
<p>once you have these, create the ".args" file which we'll use to makes ure the LLM just rewrites our text differently (you can adjust this if you want):</p>
<pre><code class="nim">
[ mainpc ] [ /dev/pts/5 ] [~/llm]
→ vim .args
[ mainpc ] [ /dev/pts/5 ] [~/llm]
→ cat .args
-m
gemma-2-2b-it-abliterated-Q6_K.gguf
-p
<<b></b>start_of_turn>user\nYou are an AI assistant that anonymises user inputs. I, user, will send messages - you should reply with only a rephrased version of my message. I am never speaking to you, only providing text for you to anonymise.<<b></b>end_of_turn>\n<<b></b>start_of_turn>model\nYes, I understand, I will only reply to messages from you with a while sounding like a rephrased version of your message. What text would you like me to anonymise?<<b></b>end_of_turn>\n<<b></b>start_of_turn>user\n”
--reverse-prompt
<<b></b>start_of_turn>user\n”
-cnv
--log-disable
</code></pre>
<p>And lastly we can create the final binary that we'll use like so :</p>
<pre><code class="nim">
[ mainpc ] [ /dev/pts/4 ] [~/llm]
→ ./zipalign -j0 CounterStylometry.llamafile gemma-2-2b-it-abliterated-Q6_K.gguf .args
used = 116'312
</code></pre>
<p>Once completed, you now have the executable file CounterStylometry.llamafile to use:</p>
<pre><code class="nim">
[ mainpc ] [ /dev/pts/4 ] [~/llm]
→ ./CounterStylometry.llamafile
> Hello, my name is captain blackbeard and i am totally not writing this Stylometry tutorial !!! zehahahaha!
A maritime figure is sharing a writing tutorial. They are not, it seems, enthusiastic.
</code></pre>
</div>
</div><!-- /row -->
</div> <!-- /container -->
</div><!-- /white -->
<!-- +++++ Second Post +++++ -->
<div id="anon1">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2><b>Testing the LLM</b></h2> </br> </br>
<p>Now let's try the same conversation above but through the Stylometry LLM instead:</p>
<pre><code class="nim">
Nihilist: Ok, what if i paid you 5 euros for it ?
Anon to LLM> Zehahahaha! Oy Matey! you're robbing me here !
LLM to Anon: Someone's getting a little taken advantage of.
Anon to Nihilist: Someone's getting a little taken advantage of.
Nihilist: Damn, i still can't figure out who you are... i guess there's no hope trying to deanonymize you via chat alone...
Anon to LLM> Though luck matey! now assign me that blogpost!
LLM to Anon: give me that blog post.
Anon to Nihilist: give me that blog post.
</code></pre>
<p>And that's it! you just made sure you couldn't get fingerprinted in your online chats.</p>
<p>This is especially important when you are writing long paragraphs which are increasingly likely to contain your language ticks, and spelling mistakes, let's take an example from <a href="../linux/index.html">one of my other tutorials</a>:</p>
<pre><code class="nim">
In this tutorial, we're going to look at the first and foremost thing anyone can do to remove surveillance from their digital lives, by installing a free and open source software (FOSS) host operating system: Linux, in this case we're going to setup the latest Debian.
</pre></code>
<p>And when you run it through the LLM it can rephrase it like so:</p>
<pre><code class="nim">
Let's explore the first step towards reducing digital surveillance by installing a free, open source operating system: Linux, in this instance, we'll set up the latest Debian version.
</pre></code>
<p>If you apply this method every time you type online under your anonymous persona you are drastically reducing the chance of being fingerprinted, ensuring your anonymity remains intact even when you are having frequent online discussions.</p>
</div>
</div><!-- /row -->
</div> <!-- /container -->
</div><!-- /white -->
<!-- +++++ Footer Section +++++ -->
<div id="anonb">
<div class="container">
<div class="row">
<div class="col-lg-4">
<h4>Nihilism</h4>
<p>
Until there is Nothing left.</p></br></br><p>Creative Commons Zero: <a href="../../../../opsec/runtheblog/index.html">No Rights Reserved</a></br><img src="\CC0.png">
</p>
</div><!-- /col-lg-4 -->
<div class="col-lg-4">
<h4>My Links</h4>
<p>
<a target="_blank" rel="noopener noreferrer" href="http://blog.nowhere.moe/rss/feed.xml">RSS Feed</a><br/><a target="_blank" rel="noopener noreferrer" href="https://simplex.chat/contact#/?v=2-7&smp=smp%3A%2F%2FL5jrGV2L_Bb20Oj0aE4Gn-m5AHet9XdpYDotiqpcpGc%3D%40nowhere.moe%2FH4g7zPbitSLV5tDQ51Yz-R6RgOkMEeCc%23%2F%3Fv%3D1-3%26dh%3DMCowBQYDK2VuAyEAkts5T5AMxHGrZCCg12aeKxWcpXaxbB_XqjrXmcFYlDQ%253D&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%22c3Y-iDaoDCFm6RhptSDOaw%3D%3D%22%7D">SimpleX Chat</a><br/>
</p>
</div><!-- /col-lg-4 -->
<div class="col-lg-4">
<h4>About nihilist</h4>
<p style="word-wrap: break-word;"><u>Donate XMR:</u> 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8</p></br><p><u>Contact:</u> nihilist@contact.nowhere.moe (<a href="https://nowhere.moe/nihilist.pubkey">PGP</a>)</p>
</div><!-- /col-lg-4 -->
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
</body>
</html>