Re: Pycrypto - active ??
Thanks Paul I will check this out. Perhaps theres a case for pycrypto to be revamped and perhaps a new python cryptographic page to be created mentioning all these projects. I have foudn it a bit difficult to find info on this area. Mny thanks for this though. -- http://mail.python.org/mailman/listinfo/python-list
Re: Pycrypto - active ??
Yes the homepage says updated, but I think that refers to more than just pycrypto. The data etc. all seems old. Perhaps it's at it's level ? I just wonder if the project itself is active and more recent docs exist to answer some of the questions I have posed. I certainly hope theres some answers. -- http://mail.python.org/mailman/listinfo/python-list
Pycrypto - active ??
Does anyone know if pycrypto is active at all. I have been browsing groups etc. for some info and have found entries from 2003 (latest) regarding some bits I was looking for in particular reference to symmetrical encoding (AES) and auto padding and supply or not of iv to set up method i.e from Crypto.Cipher import AES from Crypto.Hash import SHA256 import random import zlib s = SHA256.new() s.update('secret') key = s.digest() x = AES.new(key, AES.MODE_CBC) # should be (key,AES.MODE_CBC,iv) iv should according to docs (which also look very old) should be a random number equal to the size of data blocks (in CBC or EBC). Does anyone know if by not supplying iv - is the data secure or not ?? Auto iv and auto padding would help this project a lot but unknown as to whether they exist. I may be missing an important point here though - so correct me where you will. It would appear to be a great shame if pyCrypto has stalled or not taken on board more seriously, there's great talk of implementing TLS, SSL etc. in the lists but little support of this visible in code or docs. The docs examples don't exist in code but getting them from ATTIC in cvs shows they are not stable, possibly not secure and not representative of the code now (and that's a couple of years ago) as an aside I have found a way to pad and remove padding at decrypt is quite simple, use zlib.compress -> pad -> encrypt then decrypt -> zlib.decompress and its just your data minus padding. -- http://mail.python.org/mailman/listinfo/python-list
wxPython cross platform taskbar
Hi All Does anyone have any peice of wxPython code thats cross platform and allows an app to be minimised in the system tray. I am hoping for windows/kde/gnome/darwin if possible. I have been playing about and have a couple of systems that nearly get there but not quite. I would llike to create an app that does this in the way limewire/skype etc. do it Hope you can help David Heres sample code that nearly gets there I think - it appears to work on ubuntu/gnome import wx ICON_STATE = 0 BLINK_STATE = 0 ID_ICON_TIMER = wx.NewId() class TaskBarApp(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (1, 1), style=wx.FRAME_NO_TASKBAR|wx.NO_FULL_REPAINT_ON_RESIZE) self.tbicon = wx.TaskBarIcon() icon = wx.Icon('yellow.ico', wx.BITMAP_TYPE_ICO) self.tbicon.SetIcon(icon, '') #wx.EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarLeftDClick) #wx.EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarRightClick) self.tbicon.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarLeftDClick) self.tbicon.Bind(wx.EVT_TASKBAR_RIGHT_UP, self.OnTaskBarRightClick) self.Bind(wx.EVT_TIMER, self.BlinkIcon, id=ID_ICON_TIMER) self.Show(True) def OnTaskBarLeftDClick(self, evt): global ICON_STATE try: self.icontimer.Stop() except: pass if ICON_STATE == 1: icon = wx.Icon('yellow.ico', wx.BITMAP_TYPE_ICO) self.tbicon.SetIcon(icon, 'Yellow') ICON_STATE = 0 else: self.SetIconTimer() ICON_STATE = 1 def OnTaskBarRightClick(self, evt): try: self.icontimer.Stop() except: pass self.tbicon.Destroy() self.Close(True) wx.GetApp().ProcessIdle() #def OnTaskBarRightClick(self, evt): #self.Close(True) #wx.GetApp().ProcessIdle() def SetIconTimer(self): self.icontimer = wx.Timer(self, ID_ICON_TIMER) wx.EVT_TIMER(self, ID_ICON_TIMER, self.BlinkIcon) self.icontimer.Start(1000) def BlinkIcon(self, evt): global BLINK_STATE if BLINK_STATE == 0: icon = wx.Icon('red.ico', wx.BITMAP_TYPE_ICO) self.tbicon.SetIcon(icon, 'Red') BLINK_STATE = 1 else: icon = wx.Icon('black.ico', wx.BITMAP_TYPE_ICO) self.tbicon.SetIcon(icon, 'Black') BLINK_STATE = 0 class MyApp(wx.App): def OnInit(self): frame = TaskBarApp(None, -1, ' ') frame.Center(wx.BOTH) frame.Show(False) return True def main(): app = MyApp(0) app.MainLoop() if __name__ == '__main__': main() -- http://mail.python.org/mailman/listinfo/python-list
Re: Encryption
perfect thanks a lot and I can be cross platform too. cool -- http://mail.python.org/mailman/listinfo/python-list
Encryption
HI hope you can help (know you can). I am looking for a very strong AIS or better symetrical encryption in python. Any suggestions ideas welcome. I have spent a lot of time looking everywhere at pycrypto and many others but is a wee bit of a minefield out there. Anyone have any experience of a true encryption (not xor or anything weak). I am looking for something strong enough to encrypt your credit card info and publish file on website (no not actually do that but have encryption strong enough if you did). Many thanks and if I have missed obvious docs please take it easy on me - I am new here :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: by reference
Many thanks Martin You right - possible and ugly. Looks like I will doing a from __future__ as it looks better and perhaps this ugly method may be depreciated. Thanks again for your help David Martin P. Hellwig wrote: > dirvine wrote: > > Yes I did > > > > I was trying to do something like (pseudo code) > > > > write: > > get files in path > > for each filename get size, type > > create dic called filename assign size:xx,type:y > > pickle to file > > > > read: > > open pickled file > > read dict name and contents (hoping unpickling file gives me the dict > > name as it was saved, which may not be true) > > do stuff with file > > > > > > and thats it. My prog is a bit more complex than this but this is the > > general idea basically read files -> create dicts of files one at a > > time, very similar to bittorrent in that take a file smash to bits and > > store links to bits in a big file. > > > > Many thanls > > David > > > > Well, although I still think you should use nested dicts doesn't say > that what you want isn't possible, take a look at this snippet: > >>> locals()['test']=dict() > >>> test > {} > >>> > It looks quite ugly too me but that is probably in the eye of the > beholder. However even the faq has some info on that: > http://www.python.org/doc/faq/programming.html#how-do-i-use-strings-to-call-functions-methods > > -- > mph -- http://mail.python.org/mailman/listinfo/python-list
Re: by reference
Yes I did I was trying to do something like (pseudo code) write: get files in path for each filename get size, type create dic called filename assign size:xx,type:y pickle to file read: open pickled file read dict name and contents (hoping unpickling file gives me the dict name as it was saved, which may not be true) do stuff with file and thats it. My prog is a bit more complex than this but this is the general idea basically read files -> create dicts of files one at a time, very similar to bittorrent in that take a file smash to bits and store links to bits in a big file. Many thanls David -- http://mail.python.org/mailman/listinfo/python-list
Re: by reference
Many thanks I will do so in the future. David -- http://mail.python.org/mailman/listinfo/python-list
Re: by reference
Thanks but I am a bit unsure as to what error I have made by posting this question. I am not trying to be funny but can you give me a pointer to the issue. Many thanks David -- http://mail.python.org/mailman/listinfo/python-list
by reference
I would like to create a dictionary based on a variable i.e read a bunch of filenames and create a dict for each one called the filename filename={} to get the filenames I trraverse teh dirs woth os.path.walk or similar Sorry I'm a bit new to python -- http://mail.python.org/mailman/listinfo/python-list