Improved keyboard wedge

You can’t steal what is freely given.

My point was I can’t really say “It is finished”. I can say it is already functional. The next step is to add a new reader. The new reader should be better from my understanding, but the current version works.

If you order an adafruit trinket m0 and one of the two readers you will have a functional wedge either now, or with the next release. From there the only changes are likely to be software upgrades.

2 Likes

Yeah I realized after I read what I sent a second time that there are very large differences in what could be considered finished, and I shouldn’t have just said “ping me at some unknown time that neither of us know”.

1 Like

Video of it in action: Prototype - YouTube

Well that was fiddly to solder:



I think I will adapt the case to fit a M0 (originally it was designed to fit a Arduino Nano) and perhaps change the interfacing method (would have preferred it without the pins but they were already on there), but it has served its purpose to me as a working prototype - it scans my implant easily through the PLA casing (see vid at top for that).

3 Likes

I can second this - it is very functional and working for me (as you can see the in the vid I published a while ago). OK, ok so in the vid I had some fun and had my implant and the wedge run a command (echo), but minutes before that it was entering in my password and logging me in to things.

I say that @Zwack but I have been using the two modes successfully: reading UID and using the password-array in the source, but I never did get the other mode working (seeking for the password in the data of the chip between the flags) - despite using various different writing apps and text methods I couldn’t get it working, I had confirmation the data was being written (as I could ready it back successfully).

1 Like

I’ve just had a thought @Zwack would this project or code be portable to a Raspberry Pico microcontroller? I recall you saying at one point it would have been advantageous to have more IO, well the Pico has a lot more GPIO’s and it is less than half the price of the Trinkey M0!

I don’t know if the Pico would have the ability to emulate the keyboard in the way that you do? My knowledge of the code and capabilities of the hardware is somewhat limited, but I just thought I would ask if you thought it possible.

1 Like

Simple answer, I don’t know. I can go and look. It might…

I still have the mechanism to write the password to a chip in progress, but I decided I need to rewrite some pieces to make it easier to do that. So it will happen, soon™.

There is no “official” library for the RC522 nor the PN532 (that I could find) but has a shield:

The Pico has Arduino support, and appears to have the necessary USB and interface support.

The MFRC522 data sheet is available from NXP as is the PN532 data sheet.

Worst case this will involve developing libraries to support these on the Pico. Best case we can use existing ones. Same goes for the USB device support.

The one feature that the Pico doesn’t appear to have is the dotstar. This would probably be easiest to replace with a neopixel (5mm through hole are available) which would take up an I/O pin or two but provide the same multi-colour output functionality. Unfortunately they cost about $1 more than the Pico itself, so I would probably just ditch that functionality myself. It was added as the dotstar was there, not because it was essential.

I will look at adding Pico support later when I have the PN532 support working.

Edited to add: The SB Components RFID shield is a Low Frequency shield incompatible with the High Frequency cards and readers that the MFRC522 and PN532 use.

Good point! I didn’t even think about requiring compatible libraries for the hardware :man_facepalming: can you tell I’m still new to coding? I’m trying to learn Python at the moment.

Sorry Zwack I know you’ve got enough on your plate with features and finishing other things, I didn’t mean to add yet another thing to your list! … I just thought I’d mention the Pico idea as it came into my head and just thought I’d ask if it was possible. It sounds like it could be promising for the future.

I agree regards the Neopixel, whilst it was a nice touch it isn’t essential for me either and I’d happily live without it.

I love the Pi Zero as a SBC for tinkering & making homemade IOT, so I’ve grown to like the RPi ecosystem and the Pico was the first Microcontroller I purchased when it came out to try play with, its incredibly low price is enticing.

1 Like

It is certainly worth looking into, and thanks for the heads up.

I don’t mind getting more ideas on my plate, but I will prioritize them… :slightly_smiling_face:

Not your first Rodeo

pfsf1968-cowboy

1 Like

Not me…

He lasted at least twice as long as I would have… :laughing:

1 Like

I love where this is going …

Here is an application/test I’ve been thinking about and finally got a chance to try:
Clone Mifare 1K (hotel key) to a chip and add the ZPKW[password]null at the end, on the unused block.
This would allow me to have the magic 1K with hotel key and the password on the same chip (soon™ to be implant)

  • Q1: is it writable
  • Q2: is the wedge gonna read the password? (It should)
  • Q3: is the reader gonna open?

Well … I was unable to add the lines …
I tried the command to write to a specific block (the same one I used to write to my Blanc test card) but it didn’t want to write.

I’ll have more opportunities to try this next week and keep everyone posted …

3 Likes

It has been a little while since I last wrote. I am waiting for my PN532 still, but I do have a Raspberry pi pico (I haven’t played with it yet)

I have started a rewrite to isolate the card reader functionality. The passwords stored in the Arduino can be encoded and the encoding/decoding functionality works.

That is actually a standalone program, but it isn’t strictly necessary. Instead of containing a UID and a password the Arduino program will end up containing strings which can be decoded with the UID. With the right UID it will end up with the header string (defined in the config.h file along with the arrays, and the reader to use) followed by a password. The header string is used to tell whether the password was decoded correctly. If you are concerned about security you should probably ensure that your header is shorter than 4 characters, or the header could be used to recover a 4 byte UID.

Not to be that guy, …but

I’ve tried to keep up on this thread but it’s hard to understand all of it, and thus I’ve lost context of where the project is

If/when the project is “done” or functional, can you please do a how to thread that’s a bit more organized?

2 Likes

Version one using a mfrc522 (which might not work with some tags) is complete.

I would recommend waiting for version two.

Once that is ready I will create a new thread with build instructions, etc.

4 Likes

Since I made the mistake of choosing the cheap shipping option for my pn532, I have been looking into improving the performance of the rc522.
According to this website (which does not support https), you can improve the performance of the rc522 by replacing some components.
I have ordered the parts and will try out this modification.

2 Likes

Thanks a lot for your efforts @Zwack!
I wanted the ability to have my reader stationary, one in the office, and one in my home office, so I don’t need to bring the actual reader. I forked your project, and adapted it to ESP32 with bluetooth support.
One benefit, besides bluetooth support, is that the ESP32 is a lot cheaper than the trinket. The ESP32 can be had for $4.50, so total cost is under $6 plus enclosure.

I’ve also added some features, firstly I’ve added serial debugging, so you can watch the serial port to see what’s going on. Secondly, I changed the termination character to a variable. The previous NULL character can now be changed to your preference. This makes it easy to use a phone app, like NFCTools, to change the password. In this example, I’ve used the $ sign as terminator:
bilde

If you are using this character in your password, you can just change the terminator in the code.

Serial output scanning a Mifare 1k using array password, another using UID, and thirdly my implanted NTAG216 with password stored:

As a side note, for some reason authentication fails with my NTAG216, so I had to disable it. I suspect there are some bits on the tag I have not set, but it works fine without auth.

3 Likes

I seriously want to build this, I’m just impatiently waiting for it to be semi finalized and I can try to stumble thru whatever code I don’t understand lol

(I’m willing to help print some cases if someone’s willing to help me make heads or tails of it :upside_down_face:)

You might want to look at the current version. NTAG support was added. The dotstar is part of the trinket, and provides some simple diagnostics (different coloured lights for different password sources), unfortunately on the Trinket the serial port is actually part of the USB functionality, which is being used for the USB Keyboard.

Once I have the new version supporting the Trinket m0, Pico, PN532 and RC522, I will have a look at your code and work that into the mix as well if I can… (esp32 support will give us 3 microcontrollers and two RFID modules, different features and price points…)

I love the idea of making the termination character changeable, I’ve already made the header into a variable so that is configurable (and the locally stored passwords can be encoded with the UID so that they can just be decoded when a chip is scanned and have a hair more protection the rest of the time.)

If you need help with that then let me know and I can go through it line by line.

1 Like