<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>~/blog &#187; steganography</title>
	<atom:link href="http://blog.cedricbonhomme.org/tag/steganography/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cedricbonhomme.org</link>
	<description></description>
	<lastBuildDate>Fri, 11 May 2012 08:05:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Mise à jour de Stéganô (cadeau à l&#8217;intérieur)</title>
		<link>http://blog.cedricbonhomme.org/2012/04/21/mise-a-jour-de-stegano-cadeau-a-linterieur/</link>
		<comments>http://blog.cedricbonhomme.org/2012/04/21/mise-a-jour-de-stegano-cadeau-a-linterieur/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 22:24:19 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[sanga]]></category>
		<category><![CDATA[stéganô]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3647</guid>
		<description><![CDATA[hg clone https://bitbucket.org/cedricbonhomme/stegano/ cd stegano/stegano wget https://lh6.googleusercontent.com/-Sntb2St4xUQ/T5HgDH90JTI/AAAAAAAADwA/IQq_7mFeUhM/s0/sanga.png python ./slsbset.py --reveal -i ./sanga.png -b OFD --generator XXX cvlc -L OFD Il faut remplacer XXX par le bon générateur (énorme indice). Ça fonctionnerai aussi avec une image de taille inférieure, mais je &#8230; <a href="http://blog.cedricbonhomme.org/2012/04/21/mise-a-jour-de-stegano-cadeau-a-linterieur/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://photos.cedricbonhomme.org/p/5a"><img src="http://cedricbonhomme.org/photos/custom/201204/5fc584-20120406T142741_870x550.jpg" width="100%" /></a></div>
<pre class="brush:shell">
hg clone https://bitbucket.org/cedricbonhomme/stegano/
cd stegano/stegano
wget https://lh6.googleusercontent.com/-Sntb2St4xUQ/T5HgDH90JTI/AAAAAAAADwA/IQq_7mFeUhM/s0/sanga.png
python ./slsbset.py --reveal -i ./sanga.png -b OFD --generator XXX
cvlc -L OFD
</pre>
<p>Il faut remplacer <strong>XXX</strong> par le bon générateur (<a href="https://bitbucket.org/cedricbonhomme/stegano/changeset/9f226eeb8908">énorme indice</a>). Ça fonctionnerai aussi avec une image de taille inférieure, mais je préfère donner une belle photo de <a href="http://wiki.cedricbonhomme.org/sanga">Sanga</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2012/04/21/mise-a-jour-de-stegano-cadeau-a-linterieur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7DC</title>
		<link>http://blog.cedricbonhomme.org/2012/01/02/7dc/</link>
		<comments>http://blog.cedricbonhomme.org/2012/01/02/7dc/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 11:34:24 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[stéganô]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3287</guid>
		<description><![CDATA[Mon premier commit pour 2012, Stéganô 0.4. J&#8217;espère pour vous que cette nouvelle année sera un bon cru. De bonnes nouvelles et un maximum d&#8217;épanouissement. Pour ma part 2012 et 2013 vont être je pense assez importantes dans ma vie.]]></description>
			<content:encoded><![CDATA[<p>Mon premier <i>commit</i> pour 2012, <a href="https://bitbucket.org/cedricbonhomme/stegano/changeset/c72548e19b64">Stéganô 0.4</a>.</p>
<p>J&#8217;espère pour vous que cette nouvelle année sera un bon cru. De bonnes nouvelles et un maximum d&#8217;épanouissement. Pour ma part 2012 et 2013 vont être je pense <i>assez importantes</i> dans ma vie.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2012/01/02/7dc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Séquence d&#8217;entiers A000217</title>
		<link>http://blog.cedricbonhomme.org/2011/12/30/sequence-dentiers-a000217/</link>
		<comments>http://blog.cedricbonhomme.org/2011/12/30/sequence-dentiers-a000217/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 11:48:33 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[stéganô]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3274</guid>
		<description><![CDATA[Un test avec la séquence d&#8217;entiers A000217. $ slsb-set --hide -i examples/pictures/Montenach.png -o ~/enc-OEIS_A000217.png --generator OEIS_A000217 -m 'Happy new year!' $ slsb-set --reveal -i ~/enc-OEIS_A000217.png --generator OEIS_A000217 Happy new year! $ slsb-set --reveal -i ~/enc-OEIS_A000217.png --generator fermat Impossible to detect &#8230; <a href="http://blog.cedricbonhomme.org/2011/12/30/sequence-dentiers-a000217/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Un test avec la séquence d&#8217;entiers <a href="http://oeis.org/A000217">A000217</a>.</p>
<pre class="brush:sh">
$ slsb-set --hide -i examples/pictures/Montenach.png -o ~/enc-OEIS_A000217.png --generator OEIS_A000217 -m 'Happy new year!'
$ slsb-set --reveal -i ~/enc-OEIS_A000217.png --generator OEIS_A000217
Happy new year!

$ slsb-set --reveal -i ~/enc-OEIS_A000217.png --generator fermat
Impossible to detect message.
</pre>
<p>Rien de bien compliqué ici. Il s&#8217;agit juste de montrer comme <a href="http://projects.cedricbonhomme.org/projects/stegano/repository/revisions/63186da927c2">il est simple d&#8217;ajouter des générateurs</a>.<br />J&#8217;ai aussi ajouté de nouveaux exemples plutôt intéressants, comme <a href="http://projects.cedricbonhomme.org/projects/stegano/repository/entry/examples/example3.sh">celui-ci</a>.</p>
<p>Merci aussi à <a href="http://lita.sciences.univ-metz.fr/~demange/">Vincent</a> qui <a href="http://projects.cedricbonhomme.org/projects/stegano/repository/revisions/f2ef4f591223">a répondu</a> à l&#8217;appel à l&#8217;aide du <a href="http://blog.cedricbonhomme.org/2011/12/29/steganographie-avec-ensembles-en-utilisant-la-fonction-identite-avec-jessica-alba/">billet précédent</a>.</p>
<p>Ce post n&#8217;est pas assez important pour mériter une photo de Sarah. Mais ne vous inquiétez pas, elle va y passer.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/12/30/sequence-dentiers-a000217/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stéganographie avec ensembles en utilisant la fonction identité (avec Jessica Alba)</title>
		<link>http://blog.cedricbonhomme.org/2011/12/29/steganographie-avec-ensembles-en-utilisant-la-fonction-identite-avec-jessica-alba/</link>
		<comments>http://blog.cedricbonhomme.org/2011/12/29/steganographie-avec-ensembles-en-utilisant-la-fonction-identite-avec-jessica-alba/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 11:04:28 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[jessica]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sex]]></category>
		<category><![CDATA[stéganô]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3247</guid>
		<description><![CDATA[Pourquoi ne pas ajouter la fonction identité ( avec son implémentation en générateur) à la liste des générateurs permettant d&#8217;engendrer les ensembles?On pourrait ensuite vérifier si on peut retrouver le message avec l&#8217;outil slsb classique. Faisons le test: # On &#8230; <a href="http://blog.cedricbonhomme.org/2011/12/29/steganographie-avec-ensembles-en-utilisant-la-fonction-identite-avec-jessica-alba/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jessica_Alba.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jessica_Alba.png" alt="Jessica Alba" title="Jessica Alba" width="601" height="806" /></a></div>
<p>Pourquoi ne pas ajouter la fonction identité (<img src="http://upload.wikimedia.org/wikipedia/fr/math/5/2/e/52e674df1c5007c4f92edaac5c8403f9.png" /> avec son <a href="http://projects.cedricbonhomme.org/projects/stegano/repository/entry/stegano/generators.py#L29">implémentation en générateur</a>) à la liste des générateurs permettant d&#8217;engendrer les ensembles?<br />On pourrait ensuite vérifier si on peut retrouver le message avec l&#8217;outil slsb classique. Faisons le test:</p>
<pre class="brush:sh">
# On cache avec l'outil slsb-set (LSB + fonction identité)
$ <strong>slsb-set</strong> --hide -i ~/<a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jessica_Alba.png">Jessica_Alba.png</a> -o ~/Jessica_Alba-enc-gen.png --generator identity -m 'Je préfère Cédric à Michael Weatherly.'

# On tente de retrouver le message avec l'outils slsb (juste LSB)
$ <strong>slsb</strong> --reveal  -i ~/<a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jessica_Alba-enc-gen.png">Jessica_Alba-enc-gen.png</a>
Je préfère Cédric à Michael Weatherly.
</pre>
<p>Et ça fonctionne! Ça peut sembler logique, mais pour moi c&#8217;était un peu la surprise. La surprise qui veut dire que ce n&#8217;est quand même pas codé n&#8217;importe comment <img src='http://blog.cedricbonhomme.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Heureusement d&#8217;autres générateurs d&#8217;ensembles sont disponibles. Voici la <a href="http://projects.cedricbonhomme.org/projects/stegano/repository/entry/stegano/generators.py">liste des générateurs déjà implémenté</a>.</p>
<p>Appel à l&#8217;aide. Si vous avez une implémentation un peu voir beaucoup plus performante que <a href="http://projects.cedricbonhomme.org/projects/stegano/repository/entry/stegano/generators.py#L111">la mienne</a> pour <a href="http://fr.wikipedia.org/wiki/Conjecture_de_Syracuse">Syracuse</a>, elle serait la bienvenue! Mais j&#8217;en doute&#8230; Syracuse: <br /><img src="http://upload.wikimedia.org/wikipedia/fr/math/c/9/2/c92885687a71c3ee85904b81e6661673.png" /></p>
<p>Post lié: <a href="http://blog.cedricbonhomme.org/2011/12/28/steganalyse-de-la-methode-lsb-avec-un-ensemble-de-nombres-decrit-par-crible-deratosthenes-avec-jennifer-morrison/"><i>Stéganalyse de la méthode LSB (avec un ensemble de nombres décrit par crible d’Eratosthenes) avec Jennifer Morrison</i></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/12/29/steganographie-avec-ensembles-en-utilisant-la-fonction-identite-avec-jessica-alba/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stéganalyse de la méthode LSB (avec un ensemble de nombres décrit par crible d&#8217;Eratosthenes) avec Jennifer Morrison</title>
		<link>http://blog.cedricbonhomme.org/2011/12/28/steganalyse-de-la-methode-lsb-avec-un-ensemble-de-nombres-decrit-par-crible-deratosthenes-avec-jennifer-morrison/</link>
		<comments>http://blog.cedricbonhomme.org/2011/12/28/steganalyse-de-la-methode-lsb-avec-un-ensemble-de-nombres-decrit-par-crible-deratosthenes-avec-jennifer-morrison/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 22:13:57 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[sex]]></category>
		<category><![CDATA[steganalyse]]></category>
		<category><![CDATA[stéganô]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3181</guid>
		<description><![CDATA[Tout d&#8217;abord afin se rafraîchir l&#8217;esprit, on pourra lire l&#8217;ancien billet Stéganalyse de la méthode LSB. Il s&#8217;agissait d&#8217;usiter la méthode dite Least Significant Beat puis de comparer la stéganalyse du fichier original et du fichier avec un message caché. &#8230; <a href="http://blog.cedricbonhomme.org/2011/12/28/steganalyse-de-la-methode-lsb-avec-un-ensemble-de-nombres-decrit-par-crible-deratosthenes-avec-jennifer-morrison/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tout d&#8217;abord afin se rafraîchir l&#8217;esprit, on pourra lire l&#8217;ancien billet <a href="http://blog.cedricbonhomme.org/2010/10/04/steganalyse-de-la-methode-lsb/"><i>Stéganalyse de la méthode LSB</i></a>. Il s&#8217;agissait d&#8217;usiter la méthode dite <i>Least Significant Beat</i> puis de comparer la stéganalyse du fichier original et du fichier avec un message caché. La conclusion était que grâce à la stéganalyse par parité il était aisé de détecter une image altérée par la méthode LSB classique.</p>
<p>Aujourd&#8217;hui nous allons en plus caché le message avec la nouvelle technique. Qui consiste à utiliser un ensemble de nombres pour sélectionner les pixels où seront cachés les données. Pour cette exemple nous allons utiliser le crible d&#8217;Eratosthenes.</p>
<p><a href="http://blog.cedricbonhomme.org/2011/03/24/elisha/">J&#8217;avais promis</a> qu&#8217;après Elisha Cuthbert nous passerions à <a href="http://en.wikipedia.org/wiki/Jennifer_Morrison">Jennifer Morrison</a>.</p>
<p>Ensuite il suffit d&#8217;exécuter les commandes:</p>
<pre class="brush:sh">
# Cache le contenu de secret.txt dans Jennifer_Morrison-original.png en utilisant l'ensemble des nombres décrit par le crible d'Eratosthenes
$ slsb-set --hide -i ./Jennifer_Morrison-original.png -o ./Jennifer_Morrison-enc-gen.png --generator eratosthenes -f ./secret.txt
# Stéganalyse du fichier résultant
$ steganalysis-parity -i ./Jennifer_Morrison-enc-gen.png -o ./Jennifer_Morrison-en-gen-steg.png

# Cache le contenu de secret.txt dans Jennifer_Morrison-original.png via la méthode <a href="http://blog.cedricbonhomme.org/2010/10/01/lena/">LSB classique</a>
$ slsb --hide -i ./Jennifer_Morrison-original.png -o ./Jennifer_Morrison-enc.png  -f ./secret.txt
# Stéganalyse du fichier résultant
$ steganalysis-parity -i ./Jennifer_Morrison-enc.png -o ./Jennifer_Morrison-en-steg.png 

# Stéganalyse du fichier original
$ steganalysis-parity -i ./Jennifer_Morrison-original.png -o ./Jennifer_Morrison-steg.png
</pre>
<p>Vous obtiendrez en résultat ces fichiers (survollez avec <a href="http://fr.wikipedia.org/wiki/Souris_(informatique)">la souris</a> les images afin de comprendre de quoi il s&#8217;agit):</p>
<div align="center">
<a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-original.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-original.png" alt="Fichier original" title="Fichier original" width="48%" class="alignleft size-full wp-image-3192" /></a> <a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-steg.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-steg.png" alt="Stéganalyse du fichier original" title="Stéganalyse du fichier original" width="48%" class="alignleft size-full wp-image-3192" /></a></p>
<p><a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-enc.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-enc.png" alt="Texte caché (LSB)" title="Texte caché (LSB)"  width="48%" class="alignleft size-full wp-image-3192" /></a> <a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-en-steg.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-en-steg.png" alt="" title="Stéganalyse de l'image avec un texte caché (LSB)" width="48%" class="alignleft size-full wp-image-3192" /></a></p>
<p><a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-enc-gen.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-enc-gen.png" alt="Texte caché (LSB + Eratosthenes)" title="Texte caché (LSB + Eratosthenes)" width="48%" class="alignleft size-full wp-image-3192" /></a> <a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-en-gen-steg.png"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-en-gen-steg.png" alt="Stéganalyse de l'image avec un texte caché (LSB + Eratosthenes)" title="Stéganalyse de l'image avec un texte caché (LSB + Eratosthenes)" width="48%" class="alignleft size-full wp-image-3192" /></a>
</div>
<p>Les 3 sublimes images de la première colonne paraissent identiques.<br >On peut observer une étrange régularité au début <a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-en-steg.png">du fichier résultant</a> de la stéganlyse de l&#8217;image dans laquelle un texte a été caché via la méthode LSB classique.<br />Par contre il est plus difficile de détecter une anomalie similaire sur <a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-en-gen-steg.png">le fichier résultant</a> de la stéganalyse de l&#8217;image dans laquelle un texte a été caché via la méthode LSB tout en utilisant un ensemble de points (ici obtenu avec le crible d&#8217;Eratosthenes).</p>
<p>Si vous ne me faites pas confiance:</p>
<pre class="brush:sh">
$ wget http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-enc.png
$ wget http://blog.cedricbonhomme.org/wp-content/uploads/2011/12/Jennifer_Morrison-enc-gen.png

$ slsb-set --reveal --generator eratosthenes -i ./Jennifer_Morrison-enc-gen.png  -b text-dec-gen.txt
$ slsb --reveal  -i ./Jennifer_Morrison-enc.png  -b text-dec.txt
$ cmp text-dec.txt text-dec-gen.txt
$ cat text-dec.txt
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.

$ slsb-set --reveal --generator fermat -i ./Jennifer_Morrison-enc-gen.png  -b text-dec-gen.txt
Impossible to detect message.
</pre>
<p>La conclusion évidente est donc qu&#8217;il est préférable de ne pas utiliser des pixels se suivants mais un ensemble de pixels bien réparti que l&#8217;on pourra retrouver afin de récupérer le message caché. Ici l&#8217;idée était donc de générer des ensembles <i>via</i> des générateurs de nombres entiers. La qualité de la répartition va donc dépendre de la suite choisie. On aurait très bien pu utiliser la suite de Fibonacci par exemple.</p>
<p>Vous trouverez plus de détails ainsi qu&#8217;un meilleur exemple à <a href="http://wiki.cedricbonhomme.org/security:steganography#steganalysis_of_the_lsb_method_with_sets">cette page</a>.</p>
<p>La prochaine fois on se fait Jessica Alba ou Sarah Michelle Gellar.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/12/28/steganalyse-de-la-methode-lsb-avec-un-ensemble-de-nombres-decrit-par-crible-deratosthenes-avec-jennifer-morrison/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stéganographie avec ensembles</title>
		<link>http://blog.cedricbonhomme.org/2011/12/28/steganographie-avec-ensembles/</link>
		<comments>http://blog.cedricbonhomme.org/2011/12/28/steganographie-avec-ensembles/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 15:45:28 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[stéganô]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3159</guid>
		<description><![CDATA[Comme promis voici une première implémenation du module de Stéganô permettant de cacher des informations (textes ou binaires) en utilisant des ensembles d&#8217;entiers. Il s&#8217;agit d&#8217;un premier jet codé entre deux parties de Nexuiz (franchement génial, on peut se faire &#8230; <a href="http://blog.cedricbonhomme.org/2011/12/28/steganographie-avec-ensembles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Comme <a href="http://blog.cedricbonhomme.org/2011/11/21/stegano-change-de-page-maison/">promis</a> voici une première implémenation du module de Stéganô permettant de cacher des informations (textes ou binaires) en utilisant des ensembles d&#8217;entiers. Il s&#8217;agit d&#8217;un premier jet codé entre deux parties de <a href="http://www.nexuiz.com/">Nexuiz</a> (franchement génial, on peut se faire une partie en réseau si ça vous tente).</p>
<p>Vous pouvez tester le nouveau module de <a href="https://bitbucket.org/cedricbonhomme/stegano">Stéganô</a> en recopiant le script ci-dessous dans un fichier <i>test-slsb-gen.sh</i> puis en l&#8217;excécutant.</p>
<pre class="brush:sh">
hg clone https://bitbucket.org/cedricbonhomme/stegano/
cd stegano/
sudo python setup.py install
echo "We're going to test a little Stéganô..."

echo "Hide the message with the Sieve of Eratosthenes..."
slsb-set <i>--hide</i> -i ./examples/pictures/Montenach.png -o ./surprise.png --generator <b>eratosthenes</b> -m 'Joyeux Noël!'
echo ""

echo "Try to reveal with Mersenne numbers..."
slsb-set <i>--reveal</i> --generator <b>mersenne</b> -i ./surprise.png
echo ""

echo "Try to reveal with fermat numbers..."
slsb-set <i>--reveal</i> --generator <b>fermat</b> -i ./surprise.png
echo ""

echo "Try to reveal with carmichael numbers..."
slsb-set <i>--reveal</i> --generator <b>carmichael</b> -i ./surprise.png
echo ""

echo "Try to reveal with Sieve of Eratosthenes..."
slsb-set <i>--reveal</i> --generator <b>eratosthenes</b> -i ./surprise.png
</pre>
<p>Vous obtiendrez le résultat suivant:</p>
<pre class="brush:sh">
cedric@montenach:~$ ./test-slsb-gen.sh
destination directory: stegano
requesting all changes
adding changesets
adding manifests
adding file changes
added 53 changesets with 115 changes to 43 files
updating to branch default
23 files updated, 0 files merged, 0 files removed, 0 files unresolved
...
We're going to test a little Stéganô...

Hide the message with the <b>Sieve of Eratosthenes</b>...

Try to reveal with <b>Mersenne</b> numbers...
Impossible to detect message.

Try to reveal with <b>fermat</b> numbers...
Impossible to detect message.

Try to reveal with <b>carmichael</b> numbers...
Impossible to detect message.

Try to reveal with <b>Sieve of Eratosthenes</b>...
Joyeux Noël!
</pre>
<p>Et voilà le message est bien découvert avec le crible d&#8217;<a href="http://oeis.org/A000040">Eratosthenes</a>. Il s&#8217;agit d&#8217;une première version et il y a des améliorations à effectuer. Cependant il est possible de déjà faire quelques tests. Pour le moment il est possible de générer des ensembles avec la suite de <a href="http://oeis.org/A000045">Fibonacci</a>, le crible d&#8217;Eratosthenes, les nombres de Fermat et <a href="http://oeis.org/A002997">Carmichael</a>. Il y a quelques problèmes avec Carmichael et <a href="http://blog.cedricbonhomme.org/2009/11/24/ackermann/">Ackermann</a>. Je ne comprends pas, j&#8217;ai pourtant un i7 <img src='http://blog.cedricbonhomme.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Je précise que dans cette implémentation la suite de fermat commence par 1,2,3,&#8230; En commençant par les premières valeurs on a des problèmes&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/12/28/steganographie-avec-ensembles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cadeau de Noël en avance</title>
		<link>http://blog.cedricbonhomme.org/2011/12/17/cadeau-de-noel-en-avance/</link>
		<comments>http://blog.cedricbonhomme.org/2011/12/17/cadeau-de-noel-en-avance/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 23:09:20 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[gift]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3115</guid>
		<description><![CDATA[$ hg clone https://bitbucket.org/cedricbonhomme/stegano $ cd stegano/stegano $ wget https://lh4.googleusercontent.com/-JsrmdDNU3yQ/TuvK72nZZLI/AAAAAAAADSE/f3yPdaKBLvg/s0/merry-christmas.png $ python slsb.py --reveal -i merry-christmas.png -b surprise.txt $ cat surprise.txt]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://photos.cedricbonhomme.org/photo/2u/view"><img src="http://cedricbonhomme.org/photos/custom/201110/1319646264-2010-12-27T18_57_31_700x960.jpg" title="Christmas gift" width="80%" /></a></div>
<pre class="brush:shell">
$ hg clone https://bitbucket.org/cedricbonhomme/stegano
$ cd stegano/stegano
$ wget https://lh4.googleusercontent.com/-JsrmdDNU3yQ/TuvK72nZZLI/AAAAAAAADSE/f3yPdaKBLvg/s0/merry-christmas.png
$ python slsb.py --reveal -i merry-christmas.png -b surprise.txt
$ cat surprise.txt
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/12/17/cadeau-de-noel-en-avance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stéganô change de page maison</title>
		<link>http://blog.cedricbonhomme.org/2011/11/21/stegano-change-de-page-maison/</link>
		<comments>http://blog.cedricbonhomme.org/2011/11/21/stegano-change-de-page-maison/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 20:54:08 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sex]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=3050</guid>
		<description><![CDATA[Stéganô a un tout nouveau wiki et tutoriel. Je vais bientôt implémenter dans Stéganô un algorithme non pur, basé sur la stéganographie à clés ou à ensembles.]]></description>
			<content:encoded><![CDATA[<p>Stéganô a un tout nouveau <a href="http://projects.cedricbonhomme.org/projects/stegano/wiki">wiki</a> et <a href="http://projects.cedricbonhomme.org/projects/stegano/wiki/Tutorial">tutoriel</a>. Je vais bientôt implémenter dans Stéganô un algorithme <i>non pur</i>, basé sur la stéganographie à clés ou à ensembles.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/11/21/stegano-change-de-page-maison/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elisha</title>
		<link>http://blog.cedricbonhomme.org/2011/03/24/elisha/</link>
		<comments>http://blog.cedricbonhomme.org/2011/03/24/elisha/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 16:02:00 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Sex]]></category>
		<category><![CDATA[Sexe]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[ElishaCuthbert]]></category>
		<category><![CDATA[sexe]]></category>

		<guid isPermaLink="false">http://blog.cedricbonhomme.org/?p=2016</guid>
		<description><![CDATA[Pour vous rafraîchir la mémoire vous pouvez d&#8217;abord lire l&#8217;article sur Lena. Nous passons maintenant à Elisha. Comme d&#8217;habitude grâce à notre Python, nous allons découvrir le petit secret que nous cache cette coquine. Voici comment procéder: $ hg clone &#8230; <a href="http://blog.cedricbonhomme.org/2011/03/24/elisha/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://blog.cedricbonhomme.org/wp-content/uploads/2011/03/Elisha-Cuthbert_enc.jpg"><img src="http://blog.cedricbonhomme.org/wp-content/uploads/2011/03/Elisha-Cuthbert_enc.jpg" alt="Elisha Cuthbert" title="Elisha Cuthbert" width="100%"  /></a></div>
<p>Pour vous rafraîchir la mémoire vous pouvez d&#8217;abord lire l&#8217;article sur <a href="http://blog.cedricbonhomme.org/2010/10/01/lena/">Lena</a>. Nous passons maintenant à <a href="http://en.wikipedia.org/wiki/Elisha_Cuthbert">Elisha</a>.</p>
<p>Comme d&#8217;habitude grâce à notre <a href="http://python.org/" title="Pas celui que tu crois">Python</a>, nous allons découvrir le petit secret que nous cache cette coquine. Voici comment procéder:</p>
<pre class="brush:shell">
$ hg clone https://bitbucket.org/cedricbonhomme/stegano
$ cd stegano/
$ wget http://blog.cedricbonhomme.org/wp-content/uploads/2011/03/Elisha-Cuthbert_enc.jpg
$ chmod u+x *.py
$ ./exif-header.py --reveal -i ./Elisha-Cuthbert_enc.jpg
</pre>
<p>Comme vous le constatez maintenant il s&#8217;agit d&#8217;une image JPEG. Le message est en fait simplement passé en base 64, compressé puis caché dans la partie description de l&#8217;image. L&#8217;avantage est qu&#8217;on ne perd pas le secret en la modifiant (compression, rognage, etc.) Cependant, contrairement à la méthode LSB, le fichier gagne quelques octets.<br />Stéganô comprend maintenant 3 techniques de stéganographies appliquées aux images. Pour plus de détails vous pouvez lire le <a href="http://wiki.cedricbonhomme.org/projects:stegano#tutorial">tutoriel de Stéganô</a> ou <a href="http://wiki.cedricbonhomme.org/security:steganography">cette page</a> en construction.</p>
<p>Pour le prochain exemple nous prendrons <a href="http://en.wikipedia.org/wiki/Jennifer_Morrison">Jennifer Morrison</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2011/03/24/elisha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Art of Steganography</title>
		<link>http://blog.cedricbonhomme.org/2010/10/25/simple-art-of-steganography/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/25/simple-art-of-steganography/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 19:42:57 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[steganography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1292</guid>
		<description><![CDATA[J&#8217;ai reçu il y a quelques jours de Vincent le mail ci-dessous. ---------- Message transmis ---------- Sujet : Simple Art of Steganography Date : jeudi 21 octobre 2010 De : *** À : *** (1) Download and open "hug me.jpg" &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/25/simple-art-of-steganography/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://en.wikipedia.org/wiki/Easter_egg_(media)"><img src="http://upload.wikimedia.org/wikipedia/commons/c/c3/Ukrainskie_pisanki.jpeg" title="Easter Egg" class="aligncenter" width="437" height="445" /></a></div>
<p>J&#8217;ai reçu il y a quelques jours de <a href="http://lita.sciences.univ-metz.fr/~demange/">Vincent</a> le mail ci-dessous.</p>
<blockquote><pre>
----------  Message transmis  ----------
Sujet : Simple Art of Steganography
Date : jeudi 21 octobre 2010
De : ***
À : ***

(1) Download and open "hug me.jpg" , it is a simple jpg picture, representing
my Teddy bear hugging ...;  rename the extension of this file to MP3, so you'll
have "hug me.mp3" , you used to think that it wont work if you simply change
the extension of a file? well you were wrong ! try it, open it [ i used
WINAMP].

can u hear it? can you hear the picture file?!  again change the file extension
to JPG and it is still a pictre file .

(2) Download and open "veronamania.jpg",  change the file extension to RAR, so
you will have "veronamania.rar",  use WinRAR [or other RAR handlers]  to
extract this file and see the other JPG file inside !

well it is called "steganography", refere to link below for complete
definition:

http://www.garykessler.net/library/steganography.html

http://en.wikipedia.org/wiki/Steganography

-------------------------------------------------------
</pre>
</blockquote>
<p>Je vais donc lui (par la même occasion, vous) répondre. Donc je pense qu&#8217;il n&#8217;y a rien de bien compliqué. Il s&#8217;agit de la technique qui consiste à concaténer un fichier (image, musique, etc.) à une archive. Test:</p>
<pre>
<blockquote>$ zip test.zip test.txt
$ cat Stop_And_Stare.ogg test.zip > Stop_And_Stare-1.ogg</pre>
</blockquote>
<p>Vous pourrez toujours écouter votre musique. En renommant l&#8217;extension vous retrouverez le fichier texte. En gros, c&#8217;est du au fait que votre logiciel se contente d&#8217;interpréter les données qu&#8217;il attend (<em>tar</em>/<em>zip</em> décodent les données compressées). Je préfère de loin <a href="http://cedric.bonhomme.free.fr/blog/index.php/archives/2010/10/01/lena/">les méthodes évoquées précédemment sur ce blog</a>. Elles sont plus marrantes et n&#8217;agrandissent pas la taille du fichier.</p>
<div align="center">&sect;</div>
<p>Tout autre chose, les archives de <a href="http://bitbucket.org/cedricbonhomme/pyaggr3g470r/">pyAggr3g470r</a> présentent maintenant mieux les <a href="http://cedric.bonhomme.free.fr/data/news-archives/InternetActu_net/2010-10-07_05:00:41.html">articles</a>. Évidemment on peut toujours exporter en fichier brut.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/25/simple-art-of-steganography/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stéganô and the Free Software Song</title>
		<link>http://blog.cedricbonhomme.org/2010/10/06/stegano-and-the-free-software-song/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/06/stegano-and-the-free-software-song/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 13:28:39 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1186</guid>
		<description><![CDATA[hg clone http://bitbucket.org/cedricbonhomme/stegano/ cd stegano wget http://www.gnu.org/music/free-software-song.ogg ./lsb-s.py --hide -i ./pictures/Montenach.png -o ./pictures/Montenach_enc.png -f ./free-software-song.ogg rm free-software-song.ogg ./lsb-s.py --reveal -i ./pictures/Montenach_enc.png -b ./cool-song.ogg Ceci seulement pour annoncer qu&#8217;une ligne de commande est disponible (avec d&#8217;autres améliorations). Plus d&#8217;informations sur le &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/06/stegano-and-the-free-software-song/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><pre>hg clone http://bitbucket.org/cedricbonhomme/stegano/
cd stegano
wget http://www.gnu.org/music/free-software-song.ogg
./lsb-s.py --hide -i ./pictures/Montenach.png -o ./pictures/Montenach_enc.png -f ./free-software-song.ogg
rm free-software-song.ogg
./lsb-s.py --reveal -i ./pictures/Montenach_enc.png -b ./cool-song.ogg</pre>
</blockquote>
<p>Ceci seulement pour annoncer qu&#8217;une ligne de commande est disponible (avec d&#8217;autres améliorations). Plus d&#8217;informations sur le <a href="http://bitbucket.org/cedricbonhomme/stegano/wiki/">Wiki</a>. Et n&#8217;hésitez pas à cacher cette fabuleuse chanson dans toutes vos images.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/06/stegano-and-the-free-software-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.gnu.org/music/free-software-song.ogg" length="326823" type="audio/ogg" />
		</item>
		<item>
		<title>Encore plus vite</title>
		<link>http://blog.cedricbonhomme.org/2010/10/05/encore-plus-vite/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/05/encore-plus-vite/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 10:04:01 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[bitwise]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[steganalyse]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1168</guid>
		<description><![CDATA[Ci-dessous une stéganalyse de cette photo. Maintenant une stéganalyse du cadeau d&#8217;hier: On constate deux choses: il reste beaucoup de place. L&#8217;algorithme de stéganographie LSB utilise le dernier bit de chaque couleur des pixels. De nombreuses implémentations utilisent les deux &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/05/encore-plus-vite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ci-dessous une <a href="http://bitbucket.org/cedricbonhomme/stegano/src/tip/steganalysis-parity.py">stéganalyse</a> de <a href="http://www.zooomr.com/photos/cedricbonhomme/9382501/">cette photo</a>.</p>
<div align="center">
<div class="wp-caption aligncenter" style="width: 410px"><a href="http://lh5.ggpht.com/_ZtPyn8ZoyCc/TKrKrjLg4OI/AAAAAAAACF0/aZz6WZpyWIM/s800/free_steganalysed.png"><img alt="Stéganalyse de l&#039;image originale" src="http://lh5.ggpht.com/_ZtPyn8ZoyCc/TKrKrjLg4OI/AAAAAAAACF0/aZz6WZpyWIM/s400/free_steganalysed.png" title="Stéganalyse de l&#039;image originale" width="400" height="267" /></a><p class="wp-caption-text">Stéganalyse de l&#039;image originale</p></div>
</div>
<p>Maintenant une stéganalyse du <a href="http://cedric.bonhomme.free.fr/blog/index.php/archives/2010/10/04/photo-libre-dirlande/">cadeau d&#8217;hier</a>:</p>
<div align="center">
<div class="wp-caption aligncenter" style="width: 410px"><a href="http://lh6.ggpht.com/_ZtPyn8ZoyCc/TKrKtXBKOXI/AAAAAAAACF4/tBAj5MzIdcA/s800/free_enc_steganalysed.png"><img alt="Stéganalyse de l&#039;image contenant un message" src="http://lh6.ggpht.com/_ZtPyn8ZoyCc/TKrKtXBKOXI/AAAAAAAACF4/tBAj5MzIdcA/s400/free_enc_steganalysed.png" title="Stéganalyse de l&#039;image contenant un message" width="400" height="267" /></a><p class="wp-caption-text">Stéganalyse de l&#039;image contenant un message</p></div>
</div>
<p>On constate deux choses:</p>
<ul>
<li>il reste beaucoup de place. L&#8217;<a href="http://bitbucket.org/cedricbonhomme/stegano/src/tip/lsb-s.py">algorithme</a> de stéganographie LSB utilise le dernier bit de chaque couleur des pixels. De nombreuses implémentations utilisent les deux derniers. Ce qui signifie que j&#8217;aurai pu utiliser une photo de seulement 5Mo pour faire la même chose.</li>
<li>des données encodées en base 64 sont facilement détectables par stéganalyse. Il faudrait ajouter du bruit et ne pas les insérer à la suite.</li>
</ul>
<p>La fonction <b>reveal</b> est aussi beaucoup <a href="http://bitbucket.org/cedricbonhomme/stegano/changeset/67255ec7ff05">plus rapide</a> grâce à Christophe qui préfère les <em>bits</em> aux <em>strings</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/05/encore-plus-vite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Photo libre d&#039;Irlande</title>
		<link>http://blog.cedricbonhomme.org/2010/10/04/photo-libre-dirlande/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/04/photo-libre-dirlande/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 19:04:40 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[hadopi]]></category>
		<category><![CDATA[Ireland]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1148</guid>
		<description><![CDATA[Petite pause avec la stéganalyse pour tester quelque chose d&#8217;un peu différent. import urllib import base64 from PIL import Image def bs(s): """ Converts an int to its bits representation as a string of 0's and 1's. """ return str(s) &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/04/photo-libre-dirlande/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Petite pause avec la stéganalyse pour tester quelque chose d&#8217;un peu différent.</p>
<blockquote>
<pre>import urllib
import base64
from PIL import Image

def bs(s):
    """
    Converts an int to its bits representation as a string of 0's and 1's.
    """
    return str(s) if s<=1 else bs(s>>1) + str(s&#038;1)

def reveal(img):
    """
    Find a message in an image
    (with the LSB technique).
    """
    width, height = img.size
    bits = ""
    for row in range(height):
        for col in range(width):
            r, g, b = img.getpixel((col, row))
            bits += bs(r)[-1] + bs(g)[-1] + bs(b)[-1]
            if int(bits[-8:], 2) == 126:
                list_of_string_bits = ["".join(list(bits[i:(i+8)])) for i in range(0, len(bits)-8, 8)]
                list_of_character = [chr(int(elem, 2)) for elem in list_of_string_bits]
                return "".join(list_of_character)
    return ""

if __name__ == '__main__':
    # Point of entry in execution mode
    urllib.urlretrieve("http://cedric.bonhomme.free.fr/images/surprise.png", "./surprise.png")
    img = Image.open("./surprise.png")
    surprise = reveal(img)
    data = base64.b64decode(surprise)
    with open("./surprise", "w") as f:
        f.write(data)</pre>
</blockquote>
<p>Le décodage pourra prendre deux ou trois minutes. Une fois le script terminé, faites un petit <strong>file ./surprise</strong>. Et vous saurez déjà quoi en faire.</p>
<p>Tout ce que je peux vous dire. <em>15 Mo is enough!</em> Largement!</p>
<p>Mmm oui, le fichier téléchargé est <a href="http://www.zooomr.com/photos/cedricbonhomme/9382501/">une photo</a> sous licence <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons</a>. Nous dirons donc que ce fichier peut être partagé.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/04/photo-libre-dirlande/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stéganalyse de la méthode LSB</title>
		<link>http://blog.cedricbonhomme.org/2010/10/04/steganalyse-de-la-methode-lsb/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/04/steganalyse-de-la-methode-lsb/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 23:01:22 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[LSB]]></category>
		<category><![CDATA[steganalyse]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1102</guid>
		<description><![CDATA[Comme expliqué dans le billet précédent la technique LSB (Least Significant Bit) est aisément attaquable. En effet si pour l&#8217;oeil modifier le bit de poids faible est invisible il n&#8217;en est pas de même pour un script Python. Nous allons &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/04/steganalyse-de-la-methode-lsb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Comme expliqué dans le <a href="http://cedric.bonhomme.free.fr/blog/index.php/archives/2010/10/01/lena/">billet précédent</a> la technique LSB (Least Significant Bit) est aisément attaquable. En effet si pour l&#8217;oeil modifier le bit de poids faible est invisible il n&#8217;en est pas de même pour un script <a href="http://www.python.org/">Python</a>. Nous allons donc utiliser une technique qui consiste tout simplement à remplacer les composantes pairs des pixels par 0 et les composantes impairs par 255. Ce qui veut dire que le pixel (132, 247, 123) deviendrait (0, 255, 255).</p>
<p>Voyons ce que cela nous donne avec l&#8217;image originale.</p>
<div align="center">
<div class="wp-caption alignleft" style="width: 355px"><a href="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06.png"><img title="Image originale" src="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06.png" alt="" width="345" height="215" /></a><p class="wp-caption-text">Image originale</p></div></p>
<p><div class="wp-caption alignleft" style="width: 355px"><a href="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06_steganalysed.png"><img title="Stéganalyse de l'image originale" src="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06_steganalysed.png" alt="" width="345" height="215" /></a><p class="wp-caption-text">Stéganalyse de l'image originale</p></div>
</div>
<p></p>
<p>On voit que la répartition n&#8217;est localement pas très uniforme (cliquez sur les images pour voir plus près).</p>
<p>Maintenant nous utilisons l&#8217;<a href="http://bitbucket.org/cedricbonhomme/stegano/src/tip/lsb-s.py">algorithme LSB</a> afin de cacher un message. Ensuite nous réalisons une <a href="http://bitbucket.org/cedricbonhomme/stegano/src/tip/steganalysis-parity.py">stéganalyse</a> sur l&#8217;image modifiée.</p>
<div align="center">
<div class="wp-caption alignleft" style="width: 355px"><a href="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06_enc.png"><img title="Image avec un texte caché" src="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06_enc.png" alt="" width="345" height="215" /></a><p class="wp-caption-text">Image avec un texte caché</p></div></p>
<p><div class="wp-caption alignleft" style="width: 355px"><a href="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06_enc_steganalysed.png"><img title="Stéganalyse de l'image avec un texte caché" src="http://cedric.bonhomme.free.fr/images/2010-08-04T15:42:06_enc_steganalysed.png" alt="" width="345" height="215" /></a><p class="wp-caption-text">Stéganalyse de l'image avec un texte caché</p></div>
</div>
<p></p>
<p>Ici on s&#8217;aperçoit nettement que la zone où se trouve dissimulé le message est plus uniforme (une des raisons de chiffrer le texte avant de le cacher). En introduisant un message dans l&#8217;image nous avons modifié le bit de poids faible (donc la parité) des composantes des pixels. Il faut aussi savoir que dans le système RGB un pixel par exemple blanc sera toujours codé (255, 255, 255) avec les appareils saturants les couleurs (les valeus sont quasi exactes).</p>
<p>J&#8217;ai une autre petite idée derrière la tête. Donc avec de la chance nous verrons bientôt une autre méthode utilisant l&#8217;entropie pour détecter un message caché dans une image, peut être même le trouver. Si mes résultats seront concluents&#8230; Nous pourrons aussi comparer les deux techniques de stéganalyse.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/04/steganalyse-de-la-methode-lsb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lena</title>
		<link>http://blog.cedricbonhomme.org/2010/10/01/lena/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/01/lena/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 22:22:40 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[Lena]]></category>
		<category><![CDATA[Lenna]]></category>
		<category><![CDATA[LSB]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1091</guid>
		<description><![CDATA[La technique de stéganographie utilisée précédemment pour cacher un message dans une photo est très loin d&#8217;être parfaite, comme Christophe la justement fait remarquer. Elle consistait simplement à remplacer la composante rouge (un octet) de chaque pixel par la valeur &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/01/lena/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://cedric.bonhomme.free.fr/images/Lenna_LSB.png"><img class="aligncenter" title="Lenna" src="http://cedric.bonhomme.free.fr/images/Lenna_LSB.png" alt="" width="400" height="400" /></a></p>
<p>La technique de stéganographie utilisée <a href="http://cedric.bonhomme.free.fr/blog/index.php/archives/2010/10/01/lenna/">précédemment</a> pour cacher un message dans une photo est très loin d&#8217;être parfaite, comme Christophe la justement fait <a href="http://www.google.com/buzz/kimble.mandel/UhoZJ6qxXdF/Lenna">remarquer</a>. Elle consistait simplement à remplacer la composante rouge (un octet) de chaque pixel par la valeur ASCII d&#8217;un caractère du message à cacher. Ceci en partant du début du fichier. La transformation est la suivante:</p>
<blockquote><p>(R, G, B)<br />
devient:<br />
(ord(ascii_character), G, B)</p></blockquote>
<p>Le rouge est totalement modifié. On altére considérablement autant de pixels que le message comporte de caractères. D&#8217;où la trace noire en haut à gauche de la photo.</p>
<p>Vous vous en doutez, il existe de meilleures façons de dissimuler un message dans une image. Par exemple la méthode bien connue <a href="http://en.wikipedia.org/wiki/Least_significant_bit">LSB</a> (Least Significant Bit). Les données sont insérées à la place des bits les moins importants. Pour chaque composante RGB on a 256 valeurs possibles et nous faisons varier uniquement le bit de poids faible. La transformation est la suivante:</p>
<blockquote><p>(R, G, B) = (0000000<strong>0</strong>, 0000000<strong>1</strong>, 0000000<strong>0</strong>)<br />
devient:<br />
(R, G, B) = (0000000<strong>1</strong>, 0000000<strong>0</strong>, 0000000<strong>1</strong>)</p></blockquote>
<p>Maintenant les composantes sont faiblement détériorées. Évidemment cette méthode encore très simple est <a href="http://web.science.mq.edu.au/~pwatters/01488899.pdf">attaquable</a>. Mais la belle Lena mérite cet effort.</p>
<p>Voici le code pour voir le message caché dans la photo de ce billet:</p>
<blockquote><pre>import urllib
from PIL import Image

def bs(s):
    """
    Convert an int to its bits representation as a string of 0's and 1's.
    """
    return str(s) if s<=1 else bs(s>>1) + str(s&#038;1)

def decode_image(img):
    """
    Find a message in an encoded image (with the
    LSB technic).
    """
    width, height = img.size
    bits, index = "", 0
    for row in range(height):
        for col in range(width):
            r, g, b = img.getpixel((col, row))
            bits += bs(r)[-1] + bs(g)[-1] + bs(b)[-1]

            if len(bits) >= 8:
                if int(bits[-8:], 2) == 126:
                    list_of_string_bits = ["".join(list(bits[i*8:(i*8)+8])) for i in range(0, len(bits)/8)]

                    list_of_character = [chr(int(elem, 2)) for elem in list_of_string_bits]
                    return "".join(list_of_character)[:-2]
    return ""

urllib.urlretrieve("http://cedric.bonhomme.free.fr/images/Lenna_LSB.png", "Lenna_LSB.png")
img = Image.open("Lenna_LSB.png")
print decode_image(img)</pre>
</blockquote>
<p>Le <a href="http://bitbucket.org/cedricbonhomme/stegano/src/tip/LSB.py">code complet</a> (cacher et retrouver un message). Il s&#8217;agit d&#8217;une première implémentation. J&#8217;ai encore quelques améliorations à effectuer, mais le script fonctionne plutôt correctement.</p>
<p>Je pense que je vais bientôt créer un dépôt Mercurial avec des algorithmes de stéganographie <img src='http://blog.cedricbonhomme.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/01/lena/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lenna</title>
		<link>http://blog.cedricbonhomme.org/2010/10/01/lenna/</link>
		<comments>http://blog.cedricbonhomme.org/2010/10/01/lenna/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 06:21:17 +0000</pubDate>
		<dc:creator>Cédric</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[steganography]]></category>
		<category><![CDATA[cs_lang:Python]]></category>
		<category><![CDATA[image_processing]]></category>
		<category><![CDATA[Lena]]></category>
		<category><![CDATA[Lenna]]></category>
		<category><![CDATA[sex]]></category>

		<guid isPermaLink="false">http://cedric.bonhomme.free.fr/blog/?p=1070</guid>
		<description><![CDATA[Découvre le message que la petite coquine Lenna te cache en utilisant ton serpent. Besoin d&#8217;un indice? import urllib from PIL import Image def decode_image(img): width, height = img.size msg = "" index = 0 for row in range(height): for &#8230; <a href="http://blog.cedricbonhomme.org/2010/10/01/lenna/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://cedric.bonhomme.free.fr/images/Lenna_Simple_Method.png"><img class="aligncenter" title="Lenna" src="http://cedric.bonhomme.free.fr/images/Lenna_Simple_Method.png" alt="" width="400" height="400" /></a></p>
<p>Découvre le message que la petite coquine <a href="http://en.wikipedia.org/wiki/Lena_Söderberg">Lenna</a> te cache en utilisant ton <a href="http://www.python.org/">serpent</a>.</p>
<p>Besoin d&#8217;un indice?</p>
<p><span id="more-1070"></span></p>
<pre>
<blockquote>

import urllib
from PIL import Image

def decode_image(img):
    width, height = img.size
    msg = ""
    index = 0
    for row in range(height):
        for col in range(width):
            r, g, b = img.getpixel((col, row))
            if row == 0 and col == 0:
                msg_length = r
            elif index &lt;= msg_length:
                msg += chr(r)
            index += 1
    return msg

urllib.urlretrieve("http://cedric.bonhomme.free.fr/images/Lenna_Simple_Method.png", "Lenna.png")
img = Image.open("Lenna.png")
print decode_image(img)</blockquote>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.cedricbonhomme.org/2010/10/01/lenna/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

