Popular recipes tagged "meta:requires=binascii"http://code.activestate.com/recipes/tags/meta:requires=binascii/2013-12-27T06:43:59-08:00ActiveState Code RecipesPublic Key Encryption (RSA) (Python)
2013-12-27T06:43:59-08:00Mohammad Taha Jahangirhttp://code.activestate.com/recipes/users/4188847/http://code.activestate.com/recipes/578797-public-key-encryption-rsa/
<p style="color: grey">
Python
recipe 578797
by <a href="/recipes/users/4188847/">Mohammad Taha Jahangir</a>
(<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/inverse/">inverse</a>, <a href="/recipes/tags/multiplicative/">multiplicative</a>, <a href="/recipes/tags/primality_testing/">primality_testing</a>, <a href="/recipes/tags/primes/">primes</a>, <a href="/recipes/tags/publickey/">publickey</a>, <a href="/recipes/tags/rsa/">rsa</a>).
Revision 3.
</p>
<p>Simple code to create and use public/private keypairs. Accompanied by a rudimentary encoder.</p>
parse png image (Python)
2013-05-27T22:02:07-07:00judyhttp://code.activestate.com/recipes/users/4186659/http://code.activestate.com/recipes/578534-parse-png-image/
<p style="color: grey">
Python
recipe 578534
by <a href="/recipes/users/4186659/">judy</a>
(<a href="/recipes/tags/height/">height</a>, <a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/parse/">parse</a>, <a href="/recipes/tags/png/">png</a>, <a href="/recipes/tags/width/">width</a>).
</p>
<p>parse png image find all chunks width height</p>
Public Key Encryption (RSA) (Python)
2012-05-12T23:34:22-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/577737-public-key-encryption-rsa/
<p style="color: grey">
Python
recipe 577737
by <a href="/recipes/users/178123/">Raymond Hettinger</a>
(<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/inverse/">inverse</a>, <a href="/recipes/tags/multiplicative/">multiplicative</a>, <a href="/recipes/tags/primality_testing/">primality_testing</a>, <a href="/recipes/tags/primes/">primes</a>, <a href="/recipes/tags/publickey/">publickey</a>, <a href="/recipes/tags/rsa/">rsa</a>).
Revision 2.
</p>
<p>Simple code to create and use public/private keypairs. Accompanied by a rudimentary encoder.</p>
Simple BER decoding in python (Python)
2010-05-26T10:05:22-07:00Dima Tisnekhttp://code.activestate.com/recipes/users/4068698/http://code.activestate.com/recipes/577244-simple-ber-decoding-in-python/
<p style="color: grey">
Python
recipe 577244
by <a href="/recipes/users/4068698/">Dima Tisnek</a>
(<a href="/recipes/tags/ber/">ber</a>, <a href="/recipes/tags/ber_tlv/">ber_tlv</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>Splits a string into BER TLV's and returns a dict of {type(hex): value(binary)}
Doesn't interpret tags, Descend into compound tags.</p>
OSPF Multicast Sniffer (Python)
2009-02-24T01:49:16-08:00Ferdy Riphagenhttp://code.activestate.com/recipes/users/4169284/http://code.activestate.com/recipes/576664-ospf-multicast-sniffer/
<p style="color: grey">
Python
recipe 576664
by <a href="/recipes/users/4169284/">Ferdy Riphagen</a>
(<a href="/recipes/tags/multicast/">multicast</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/ospf/">ospf</a>).
Revision 2.
</p>
<p>Add's a listener to multicast group 224.0.0.5 (AllSPFRouters),
waits for an OSPF hello packet and extract the most important info.
Won't work on Win32...</p>
binascii.crc32 result to hex (Python)
2007-06-14T06:25:57-07:00Denis Barmenkovhttp://code.activestate.com/recipes/users/57155/http://code.activestate.com/recipes/521907-binasciicrc32-result-to-hex/
<p style="color: grey">
Python
recipe 521907
by <a href="/recipes/users/57155/">Denis Barmenkov</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>).
</p>
<p>Function becomes useful when we need hex value of crc32() result, even if it is negative.</p>
A foldable panel with a Windows XP look and feel (wxPython) (Python)
2006-08-02T02:55:40-07:00Egor Zindyhttp://code.activestate.com/recipes/users/2493385/http://code.activestate.com/recipes/496929-a-foldable-panel-with-a-windows-xp-look-and-feel-w/
<p style="color: grey">
Python
recipe 496929
by <a href="/recipes/users/2493385/">Egor Zindy</a>
.
</p>
<p>I wrote this foldable panel to keep the look of my applications consistant with Windows. The code is extremely simple and is nowhere as flexible as the foldable panel already available in wxPython. Demo available in the code.</p>
convert a directory full of png images to a (wxPython) module (Python)
2006-08-02T06:43:56-07:00Egor Zindyhttp://code.activestate.com/recipes/users/2493385/http://code.activestate.com/recipes/496933-convert-a-directory-full-of-png-images-to-a-wxpyth/
<p style="color: grey">
Python
recipe 496933
by <a href="/recipes/users/2493385/">Egor Zindy</a>
(<a href="/recipes/tags/graphics/">graphics</a>).
</p>
<p>I use this utility to generate an "images.py" module which I use to provide images to my applications via wx.ImageFromStream . You can see an output in my other recipe "A foldable panel with a Windows XP look and feel". The utility is called "convert.py" and can be put in a folder together with the png images. When run, it'll generate the "images.py" file which can be moved to wherever it'll be used. The only thing I'm checking for is that "convert.py" won't overwrite an existing "images.py" file in the same directory.</p>
parse and create fixed size binary data (records / structs) (Python)
2005-12-21T11:52:06-08:00Maciej Obarskihttp://code.activestate.com/recipes/users/2559120/http://code.activestate.com/recipes/465219-parse-and-create-fixed-size-binary-data-records-st/
<p style="color: grey">
Python
recipe 465219
by <a href="/recipes/users/2559120/">Maciej Obarski</a>
(<a href="/recipes/tags/database/">database</a>).
</p>
<p>Python's struct library is too low-level for direct usage. This recipe (only 40 lines) shows how it can be turned into more developer-friendly tool.</p>
adduser/login/passwd/userdel (not posix) password db access (Python)
2002-02-20T12:50:29-08:00Nelson Rushhttp://code.activestate.com/recipes/users/144881/http://code.activestate.com/recipes/115419-adduserloginpasswduserdel-not-posix-password-db-ac/
<p style="color: grey">
Python
recipe 115419
by <a href="/recipes/users/144881/">Nelson Rush</a>
.
</p>
<p>Let's you create a password db and let users login, etc.
This is not a real password system, its just something I came up with.
Ie. Don't try using this on /etc/passwd</p>