<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Django Encryption &#8211; An Updated How-To</title>
	<atom:link href="http://bryanhelmig.com/django-encryption/feed/" rel="self" type="application/rss+xml" />
	<link>http://bryanhelmig.com/django-encryption/</link>
	<description>...does nerdy things.</description>
	<lastBuildDate>Thu, 01 Dec 2011 17:30:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: shay</title>
		<link>http://bryanhelmig.com/django-encryption/comment-page-1/#comment-791</link>
		<dc:creator>shay</dc:creator>
		<pubDate>Mon, 12 Sep 2011 12:08:45 +0000</pubDate>
		<guid isPermaLink="false">http://bryanhelmig.com/?p=213#comment-791</guid>
		<description>Thanks, very helpful.
I just added multi laguage support

def to_python(self, value):
    if self._is_encrypted(value):
        return self.cipher.decrypt(binascii.a2b_hex(value[len(self.prefix):])).split(&#039;&#039;)[0].decode(&#039;utf8&#039;)
    return value

def get_db_prep_value(self, value, connection, prepared=False):
    if value is not None and not self._is_encrypted(value):
        value = value.encode(&#039;utf8&#039;)
        padding = self._get_padding(value)
        if padding &gt; 0:
            value += &quot;&quot; + &#039;&#039;.join([random.choice(string.printable) for index in range(padding - 1)])
        value = self.prefix + binascii.b2a_hex(self.cipher.encrypt(value))
        return value</description>
		<content:encoded><![CDATA[<p>Thanks, very helpful.<br />
I just added multi laguage support</p>
<p>def to_python(self, value):<br />
    if self._is_encrypted(value):<br />
        return self.cipher.decrypt(binascii.a2b_hex(value[len(self.prefix):])).split(&#8221;)[0].decode(&#8216;utf8&#8242;)<br />
    return value</p>
<p>def get_db_prep_value(self, value, connection, prepared=False):<br />
    if value is not None and not self._is_encrypted(value):<br />
        value = value.encode(&#8216;utf8&#8242;)<br />
        padding = self._get_padding(value)<br />
        if padding &gt; 0:<br />
            value += &#8220;&#8221; + &#8221;.join([random.choice(string.printable) for index in range(padding - 1)])<br />
        value = self.prefix + binascii.b2a_hex(self.cipher.encrypt(value))<br />
        return value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arkaitz</title>
		<link>http://bryanhelmig.com/django-encryption/comment-page-1/#comment-784</link>
		<dc:creator>Arkaitz</dc:creator>
		<pubDate>Thu, 08 Sep 2011 09:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://bryanhelmig.com/?p=213#comment-784</guid>
		<description>Hi,
I&#039;m trying hard to implement your snipped but using initialization vector. I have no problem on declaring iv into __init__, but the problem seems to come when decrypting: I use a randomized iv, so each db entry  has its own iv, and I include it after the prefix. I think that I&#039;m doing it well when extracting iv from the data (value), but it fails to decrypt. I think that it can be caused by the fact that cipher is declared in __init__, and in your example is basically the same every time it&#039;s called. So, how can I fix it?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;m trying hard to implement your snipped but using initialization vector. I have no problem on declaring iv into __init__, but the problem seems to come when decrypting: I use a randomized iv, so each db entry  has its own iv, and I include it after the prefix. I think that I&#8217;m doing it well when extracting iv from the data (value), but it fails to decrypt. I think that it can be caused by the fact that cipher is declared in __init__, and in your example is basically the same every time it&#8217;s called. So, how can I fix it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodrigo Abreu</title>
		<link>http://bryanhelmig.com/django-encryption/comment-page-1/#comment-748</link>
		<dc:creator>Rodrigo Abreu</dc:creator>
		<pubDate>Sun, 10 Apr 2011 18:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://bryanhelmig.com/?p=213#comment-748</guid>
		<description>I tried adapting it for FileField&#039;s but it didn&#039;t work. How would you do it?

Thanks.</description>
		<content:encoded><![CDATA[<p>I tried adapting it for FileField&#8217;s but it didn&#8217;t work. How would you do it?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shay</title>
		<link>http://bryanhelmig.com/django-encryption/comment-page-1/#comment-666</link>
		<dc:creator>Shay</dc:creator>
		<pubDate>Mon, 26 Jul 2010 10:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://bryanhelmig.com/?p=213#comment-666</guid>
		<description>my bad I was using PasswordInput widget with render_value=False</description>
		<content:encoded><![CDATA[<p>my bad I was using PasswordInput widget with render_value=False</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shay</title>
		<link>http://bryanhelmig.com/django-encryption/comment-page-1/#comment-665</link>
		<dc:creator>Shay</dc:creator>
		<pubDate>Mon, 26 Jul 2010 08:42:48 +0000</pubDate>
		<guid isPermaLink="false">http://bryanhelmig.com/?p=213#comment-665</guid>
		<description>Thanks Bryan, however django always ask to renter this filed when saving my admin form. can&#039;t it ignore the field when no new data is typed in?</description>
		<content:encoded><![CDATA[<p>Thanks Bryan, however django always ask to renter this filed when saving my admin form. can&#8217;t it ignore the field when no new data is typed in?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

