Introduction: The PinTin Nano - Your Edison-Based Password Keeper
I'm Daniel, a professional software developer. This is my very first instructable, and I'm über-excited. I hope you'll like. :)
With this instructable, I try to solve a problem everyone has: Passwords. Accounts. Logins. All the stuff you need to get into your favourite social media site, shopping site, blog or forum (they still exist, huh?). Now, there are several ways to control your accounts:
- Use always the same credentials: No. Never ever do that. Seriously. If your account gets hacked on one site, chance is that the hacker(s) will try the credentials on other, popular sites also. Don't underestimate them. They are smart. Criminals, but smart.
- Use a software on every device: You can do that. And if you are lucky, this software will run forever on this device. But maybe, at some point, you will get rid of the devices. Uh-oh...
- Write them down: Yepp. You can do that. But - everyone who finds your book will be able to read your passwords. That wouldn't be that great, right?
To solve all of this, I created a device called "The PinTin Nano". It has it's name from the fact that it's a) pretty small and b) fits in a mint tin. I love that, because that makes the device easy to carry around.
Step 1: The Shopping List
First, you will need to go shopping. And yes, this one is going to be expensive, sorry...
- Intel Edison
- A base board (any board will do which allows you to activate WiFi on the Edison, so normally a board with a console port)
- The OLED block from Sparkfun
- The Battery block from Sparkfun
- A Hardware pack from Sparkfun
- A small lipo battery (depending on your tin)
- A mint tin (important!)
- Micro USB-cable
Roughly calculated, you will be at around 120 USD for all of this, so this is quite a lot.
A word of wisdom in terms of the hardware pack: Some dealers still have the pack with the long screws around. Make sure you get the right, as they wouldn't fit that great otherwise.
The tin I'm using has the size of 7 cm x 6 cm x 2 cm (roughly). Depending on the tin you are using, you can alter the lipo battery you are using. I had to go with a smaller one, because the large one won't fit.
Ok - ready? You've got everthing? Perfect. Let's continue!
Step 2: Assemble Everything
To continue working on the project, you'll need to assemble everything. This is pretty straight forward:
For starters, you will need to attach the Edison to a base board or similar. After you've done everything to connect it via ssh, you can disconnect it from the base board, and attach it directly to the Battery Board.
If you want to put it into the tin that I'm using, you will need a different type of battery, a smaller one. Replacing the battery is pretty easy though, as you can see in the pictures.
Step 3: Prepare the Edison
Well, this step has been covered by quite a lot of instructables so far, so I won't repeat everything here., just the tricky stuff.
For the initial setup, you can head over to Sparkfun, as they have a really, really great tutorial on how to get everthing to work:
You can also do the Arduino-related parts, just for testing purpose. We don't need any Arduino IDE here. As you can see in the screenshot, I'm running the pong sample on the device. This also tests the oled.
The tricky parts are related to the configuration of the edison. Sometimes, you'll have the problem that it won' connect to your wifi. This is related to the USB ethernet interface using the same subnet as the wifi, so they collide.
Solution is provided in this thread https://communities.intel.com/thread/55527 , so make sure to check that one out. Furthermore, make sure that you gave the Edison a root password during the initial setup, otherwise you won't be able to connect to wifi automatically.
Step 4: Install Mono
This one is a little bit more advanced, but I'm sure you'll make it. C'mon, you've come this far!
After you updated the Edison to the latest image, open your terminal and run vi with this command:
Now, insert the following lines:
Cool. Now save everything, and run
Finally, install mono:
opkg install mono
Step 5: Get the Program
This one should be easy for you, after completing all the steps before. Simply download the latest release from the PinTinNano repository:
Extract that in your user folder. Now, if everything worked fine, you should be able to run:
in the folder you just created. It shoud greet you with a nice "Hi :)"
Cool! Now, you should be ready for the final step.
Step 6: Excurse: the Code
If you are not that into coding, you can skip this paragraph, as I will provide some insides on the codebase.
The PinTin Nano has been written in C# with reusability in mind. I can "unplug" the core of the program (encryption routine and database), and put that e.g. in a WPF program on Windows. This gives a lot of flexibility.
Furthermore, to work with the c++ oled library, I created a c wrapper dll, which I can call via PInvoke from C#. This is a pretty cool experience.
Btw, these are the following libraries I use in the PinTinNano:
http://www.bouncycastle.org/csharp/ (MIT X11 Adaption)
To be on the safe side, I've put the PinTinNano under a GPL license, because of the GPL nature of the OLED-libraries from Sparkfun.
Step 7: Using It
As requested in the comments, I'll give you a little walkthrough the user interface. If you are more the cinema guy, make sure you check out the video!
Starting and Logging In
After starting the program, you will be greeted with "Hi :)". I was very, very creative at that moment. Well...
You will then have to enter a password (either a new one, if you start the program for the first time, or your well established one). Selection of the letters is "NES-style", so you use the joystick to navigate through the alphabet. Using the buttons on the right, you can switch between small letters, capital letters and numbers/special chars. If you want to save everything, just move the cursor to the "y" in the lower right corner, and press on the white joystick (I will call that action SELECT in the next paragraphs).
Once you confirmed the "Loaded." with SELECT, a menu will show up, which allows you to view a list of your current passwordentries, and to add new ones. The other options can be considered as "Under Construction" ;)
View an Entry
Once you press SELECT again while on the "LIST" item, you will enter the list of all you password entries. Pagination is done via the buttons on the right: The lower button will move one page forward, the upper one page back. You can leave this list by pressing the joystick to the right.
While you are on an entry, press again SELECT. You then have the option to paginate through the entry by using the buttons on the right. You will see (in this order): Uri => Username => Password => Note. Again, leave this screen by pressing LEFT on the joystick.
Adding a New Entry
Now, you might want to add a new entry. That's really easy. Move the cursor to "New" and SELECT the entry. You will then see a screen with the heading "title", and the same input interface you already know from the password dialog. Enter your favourite title. At the moment, this should not be longer then 9 characters, but this will be fixed quite soon. It's just - well, pre-release. After confirming the entry, a next screen will show up, asking for the "Uri". Repeat the same procedure for this, and afterwards for "Username", "Password" and "Note". After the last screen, the data will be stored and when everything is done, you will see a "Stored!" message that you will need to confirm with "OK".
Step 8: Autostart! Awesome!
We'll add the PinTinNano.exe to /etc/init.d, so that it runs after the system booted. You won't then need to login to start the PinTinNano interface, so you can just power it up.
It's actually pretty simple. cd into etc:
root@PinTin:~# cd /etc/
Then, create the folder init.d, if it doesn't already exist, and cd into it:
root@PinTin:/etc# mkdir init.d
root@PinTin:/etc# cd init.d/
Using your favorite text editor, you create a file called pintinnano.sh. Then simply put this content into the file:
root@PinTin:/etc/init.d# vi pintinnano.sh
root@PinTin:/etc/init.d# cat pintinnano.sh
This assumes, that you extracted everything in your home (aka root) folder. Now, make everything executable:
root@PinTin:/etc/init.d# chmod +x /pintinnano.sh
Now you can check if it already runs. :)
If it does, you can perform a update-rc.d:
root@PinTin:/etc/init.d# update-rc.d pintinnano.sh defaults
Finally, perform a reboot and see, if everything works as expected. You're done! (phew...)
Step 9: Conclusion
We are done here. And of course, we are not. (huh?)
As I already mentioned in the video, I will continue to work on the PinTin Nano as often as I can. I'm really eager to get the part with the web interface started. Furthermore, such essential features as deleting an entry will be added really, really soon.
Also, I would like to tweak the tin a bit, so it can house the edison a lot better, and I don't have to take things out.
Just a small hint - the software is in a pre-release state, so things might change. And break.
Anyway, I hope you liked my first instructable. I had a fun time doing the instructable, creating the video and doing the photos. I will definitely do it again. :)