I’m on GitHub : CrConstantin.
My projects here are :
Bottle password generator is designed to… (you will never guess this :)) generate passwords.
I know there was at least 1 other project that does exactly what my project does, but the passwords for that one were only 6 characters and the generator is online and the connection was not secure, so it would be possible for someone to sniff the passwords before they reach the server.
So, my little program can run locally (127.0.0.1), you could run it on the local network IP, or deploy it in the cloud (using a Secure SSL connection).
It’s written in Python, dependencies: Bottle and PyCrypto (2.5). It’s compatible with any Linux and Windows system (on Windows, you need to install Active Python and PyCrypto via PyPM).
There are two methods to generate passwords:
The project is hosted by GitHub: Pwd_gen.
You can also play with it online.
Enjoy the print screens:
Yesterday I participated to Hack Days event. The theme if this meet-up was “making life easier”. Me and my friend Andrei were thinking to make a little program that uses the webcam to watch for certain “trigger images”. Each of this images has an event attached, so when the image appears, the event happens. The event should be anything in command line, a python or perl script, or a program with parameters.
Why would you need something like that ? Well, for example, you are in bed and you watch a movie and your mobile phone rings, you want to pause the movie. You raise a little card and the movie pauses. After you talk on the phone, you raise another card and the movie resumes; in this case, the event is local, but the system should permit sending the signal on the network, using sockets. For example, you can have the webcam watch for defects on the assembly line and send some signals to a central server, etc, etc.
So, this “framework” should contain 2 parts : you capture the “trigger images” and define the event, you start the webcam service and wait for the trigger to appear.
Andrei is working in Java on Windows, I’m working in Python on Ubuntu. The GUI should be in Java and the image detection should be in Python.
At first, we tried to take captures in the GUI using Java Media Framework, but jmf 2.1.1 installer for linux is broken, you can’t install anything. To fix it, you have to edit the installer with VIM, search for “tail”, replace “tail +309 $0 > $outname” with “tail -n +309 $0 > $outname”, then you install, then you “chown your_user /usr/bin/JMF-2.1.1e/lib/jmf.properties”, to be able to make any changes to the properties file. And after all this, we discovered that jmfRegistry doesn’t recognize my laptop webcam… Even if the webcam can be used by Cheese and OpenCV…
Finally, we managed to connect the Java GUI, with Python image recognition, using sockets.
This is a print screen of the interface:
And this is the code for python:
import cv import glob import socket HOST = '192.168.1.2' PORT = 7777 print('Connecting to socket server...') ss = socket.create_connection((HOST,PORT), 3600) # Timeout 1h ss.send('hello server!\n') capture = cv.CreateCameraCapture(0) frame = cv.QueryFrame(capture) pngs = glob.glob('*.png') # The trigger images must be PNG imgs_to_find = [cv.LoadImage(img, cv.CV_LOAD_IMAGE_COLOR) for img in pngs] W,H = cv.GetSize(frame) while True: frame = cv.QueryFrame(capture) cv.Flip(frame, frame, 1) for i in range(len(imgs_to_find)): to_find = imgs_to_find[i] w,h = cv.GetSize(to_find) width = W - w + 1 height = H - h + 1 result = cv.CreateImage((width,height), 32, 1) cv.MatchTemplate(frame, to_find, result, cv.CV_TM_SQDIFF_NORMED) (minval,maxval,minloc,maxloc) = cv.MinMaxLoc(result) (x,y) = minloc # The smaller the value, the more precise is the detection if minval <= 0.09: print 'Found:', pngs[i], minval ss.send(pngs[i]+'\n') ss.recv(1024) # De-comment the next 2 lines to view the webcam image in "standalone mode" # cv.Rectangle(frame,(int(x),int(y)),(int(x)+w,int(y)+h),(255,0,0),3,0) # cv.ShowImage('View', frame) if cv.WaitKey(10) >= 0: break #
Maybe you find it useful.
All in all, great event !
Thank you Liviu, thank you UberVU ! We will participate next time too !
Scrambled-Egg is made for compressing and encrypting your data. It’s intuitive and fast. The input data can be : plain text, formatted text, or a binary file (currently not supported from GUI). The result can be kept/sent as printable plain text, or as a little square image.
Scrambled-Egg is not a text editor. If you want to use formatted text, write your text in a text processor (Microsoft Word, Open Office, etc), then paste, or drag and drop the formatted text in the left text-box.
The original data is scrambled in 3 steps :
All 3 steps are important, you should use them all. The password is optional, and it’s only used in step 2 (encryption). Step 3 (post processing) is required, the rest are optional.
There are 3 methods to encrypt you data: first is by using the graphical user interface ; second method is in command line ; third requires to know a little Python, you can import the ScrambledEgg class and use it in your Python program.
The Python API is heavily tested, on hundreds of files, but unfortunately, the GUI has a few bugs that I can’t fix, because they are hard to kill and I need more time. The good news is that I’m working on a new version that will run in browser, it will fix the bugs and will look much better. There will be some new features too.
For now, enjoy the print screens for current version. :)