gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Project: Secure texteditor with encryption

#177823 - Urben - Sat Mar 23, 2013 2:27 am

Hi, Im a beginner and my project is:

A texteditor, where I can:
  • create textfiles (~1000 characters big)
  • encrypted them with a long password
  • strong encryption, fast decryption
  • edit the text
  • at least the small ascii character set
  • multiple textfiles with individual passwords
  • textfiles saved as savedgames
  • hardware: EZ Flash IV + GBA Micro


I want to use it to save passwords and some other private informations I could need sometimes underway.


The problems:
  • never programmed in C, but something like C++
  • looking for good tutorials (especially for pointers)
  • the EZ Flash saves the unwritten data when shut down (secure problem)
  • which encryption? How about this compact AES?


So, how should I start? Ideas? Help? Similar projects?

#177824 - Bregalad - Sat Mar 23, 2013 1:30 pm

Edit text with only 6 buttons and a D-Pad ? Sounds painful.

#177825 - WriteASM - Sat Mar 23, 2013 2:14 pm

Entering text with the GBA's built-in buttons is actually somewhat feasible when you consider that the direction pad can choose any of 8 combinations. Add in A/B for "viewport selection", and you have 32 characters possible with minimal button pressing. Add another button for changing the "keyboard", and you get uppercase, lowercase, and numerics, plus lots of symbols. (I have been writing a "bASMic" BASIC editor and interpreter for the GBA, which uses this technique. It is written in 100% ASM.) Screenshot: [Images not permitted - Click here to view it]

I have not tried it yet, but you may also be able to interface a PS/2 keyboard to the GBA. Although the keyboards are technically 5v, they seem to initialize just fine with 3.3v (although the GBA's battery won't last too long, as the keyboards are power hungry!) The GBA's link port has a shift-clock mode, which is almost perfect for this. I did a websearch on "PS/2 keyboard interface", and found this: http://www.pyroelectro.com/tutorials/ps2_keyboard_interface/theory.html. It's not for the GBA...but the ideas are there.

~1000 characters long? If you use a simple 8x8 font, and don't want to scroll the screen, then only 600 characters fit on the screen (30 columns, 20 rows). However, the GBA supports map sizes up to 64?64 (only 30?20 visible at one time), or 4096 characters. Scrolling the screen by moving the map is very easy.

How to start? My usual method of starting to program something (especially if you've never programmed for the GBA before) is to start tinkering with some example projects. DevKitPRO has some nice examples in C. However, you aren't limited to programming the GBA in C, as there's also a BASIC compiler called DragonBASIC, and of course, ASM.

Hope this helps.