# Improved keyboard wedge

**URL:** <https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642>\
**Category:** Projects\
**Created:** [September 29, 2021, 8:23am UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642 "2021-09-29T08:23:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 29, 2021, 8:23am UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/1 "2021-09-29T08:23:51Z")

</div>

So, I have a half working prototype of an improved keyboard wedge. So far I can pull a passphrase from a random location on a mifare 1k.

Tomorrow I will start work on the USB keyboard output portion.

 ![16329033075878534119742640890683](https://dangerousthings-forum.b-cdn.net/original/2X/9/9f365d725a7a4285d8df86c712ababee08c7089e.jpeg)

This is an RC522 RFID reader attached to an adafruit trinket m0. The trinket is mounted on a small breadboard for ease of use and the white wire is not actually in use it was just plugged in up there to keep it out of the way.

Total parts cost about $15. I was originally going to use a digispark but it wasn’t much cheaper and had a much less capable chip on it.

I will document it more thoroughly once I have the keyboard part working.

---

<div class="post-metadata">

**Author:** ![Eriequiet](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/eriequiet/32/6437_2.png) [@Eriequiet](https://forum.dangerousthings.com/u/Eriequiet)\
**Post date:** [September 29, 2021, 9:29am UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/2 "2021-09-29T09:29:37Z")

</div>

Will it be alpha numeric capable?  
Any ntag compatibility?

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 29, 2021, 11:20am UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/3 "2021-09-29T11:20:21Z")

</div>

Yes, it should be able to produce any sequence that you can type, the idea is that you can store any valid password and “type” it in for you.

I have tested an Ntag216 and it should work, but that is part of the expanded card work for later.

---

<div class="post-metadata">

**Author:** ![XEMON](https://forum.dangerousthings.com/letter_avatar_proxy/v4/letter/x/ee7513/32.png) [@XEMON](https://forum.dangerousthings.com/u/XEMON)\
**Post date:** [September 29, 2021, 2:36pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/4 "2021-09-29T14:36:30Z")

</div>

This is so cool, are you planning on publishing the code?  
If so, I’ll pick up the parts and make a 3D printed case for it.

Edit: I’m not sure if it was clear, but I’ll post it and send you a few if you want them.

---

<div class="post-metadata">

**Author:** ![Hanan](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/hanan/32/7486_2.png) [@Hanan](https://forum.dangerousthings.com/u/Hanan)\
**Post date:** [September 29, 2021, 2:51pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/5 "2021-09-29T14:51:12Z")

</div>

Hi  
Can you give examples of the uses?

Hanan

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 29, 2021, 5:52pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/6 "2021-09-29T17:52:22Z")

</div>

I am planning on publishing the code, and it will be open to others to do what they want with it.

I will also provide detailed instructions.

The card reader module is about half the size of a credit card, while the trinket m0 is about 1" x 0.5" (25mm x 12mm)

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 29, 2021, 5:56pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/7 "2021-09-29T17:56:32Z")

</div>

The main intended use is to have a changeable password stored on an RFID chip. The [KBR1](https://dangerousthings.com/product/kbr1/) only outputs the UID, but that isn’t normally changeable. This allows you to have an arbitrary length of password, with a mix of characters and instead of typing it you scan your RFID card and it pretends to be a USB keyboard and “types” the password for you.

This allows people with more restrictive password policies to use an RFID chip for their password.

---

<div class="post-metadata">

**Author:** ![Hanan](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/hanan/32/7486_2.png) [@Hanan](https://forum.dangerousthings.com/u/Hanan)\
**Post date:** [September 29, 2021, 6:26pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/8 "2021-09-29T18:26:37Z")

</div>

I like it!  
Please make it simple to implement 😇

---

<div class="post-metadata">

**Author:** ![XEMON](https://forum.dangerousthings.com/letter_avatar_proxy/v4/letter/x/ee7513/32.png) [@XEMON](https://forum.dangerousthings.com/u/XEMON)\
**Post date:** [September 29, 2021, 7:01pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/9 "2021-09-29T19:01:17Z")

</div>

> [@Zwack](#):
>
> This allows you to have an arbitrary length of password, with a mix of characters and instead of typing it you scan your RFID card and it pretends to be a USB keyboard and “types” the password for you.

That’s exactly what I was hopping 👍  
Thanks for working on this.

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 30, 2021, 6:23am UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/10 "2021-09-30T06:23:26Z")

</div>

So, I now have a working keyboard wedge, but I want to do some more testing, and increase the number of card types it can use.

At the moment only MiFare 1Kb cards are supported.

If a card is presented to the reader it looks for the string DNGR and then writes from there until the first null byte out as a USB keyboard, it then sends a return keystroke.

Electronically you need an adafruit trinket m0 and an RC522 RFID card reader with an SPI interface. Seven connections need to be made, and while female to female Dupont wires will work you do need to solder the headers onto the Trinket M0.

The connections from the RC522 to the Trinket are:  
RC522 - Trinket M0  
SDA - 0  
SCK - 3  
MOSI - 4  
MISO - 2  
IRQ - No Connection  
GND - Gnd  
RST - 1  
3.3V - 3V

You will also need a micro USB to whatever format your host USB port is cable.

I will write up a more complete document with pictures and upload it with the Arduino sketch once I have added a few more card types.

I will also see if I can put together a starter guide on how to upload an Arduino sketch to the trinket.

---

<div class="post-metadata">

**Author:** ![XEMON](https://forum.dangerousthings.com/letter_avatar_proxy/v4/letter/x/ee7513/32.png) [@XEMON](https://forum.dangerousthings.com/u/XEMON)\
**Post date:** [September 30, 2021, 2:54pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/11 "2021-09-30T14:54:17Z")

</div>

Awesome 👍  
Thanks for posting the wiring, I should have my parts by end of week. Hopefully I can have a first run at a box sometime next week …

Also looking forward to your code for other projects 😅  
I really suck at coding (I mostly do ladder logic), but hardware all day long …

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 30, 2021, 6:59pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/12 "2021-09-30T18:59:28Z")

</div>

It has struck me that I am handcrafting the tag with the password on it. Do I need to add a mechanism to write a password to the tag?

Triggering that is going to be harder as I don’t believe we have any spare I/O ports on the Trinket M0. (If someone was to create a custom board we could free up some of the I/O ports used internally and add a “write mode” button.)

---

<div class="post-metadata">

**Author:** ![XEMON](https://forum.dangerousthings.com/letter_avatar_proxy/v4/letter/x/ee7513/32.png) [@XEMON](https://forum.dangerousthings.com/u/XEMON)\
**Post date:** [September 30, 2021, 7:07pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/13 "2021-09-30T19:07:54Z")

</div>

What about going into the code/IDE when adding/removing tag and passes and re-upload to the chip?  
It avoid and tag management and re-write code …

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 30, 2021, 7:14pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/14 "2021-09-30T19:14:14Z")

</div>

There is no tag management. The [KBR1](https://dangerousthings.com/product/kbr1/) Reads any tag and outputs the UID so you can use the UID as all or part of your password.

This reads the tag data looking for DNGR(pa$$w0rd)\NULL where \NULL is a zero value byte and (pa$$w0rd) is any password string and it outputs the password string.

So multiple people can use the same wedge to login but different passwords.

---

<div class="post-metadata">

**Author:** ![Devilclarke](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/devilclarke/32/19069_2.png) [@Devilclarke](https://forum.dangerousthings.com/u/Devilclarke)\
**Post date:** [September 30, 2021, 7:15pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/15 "2021-09-30T19:15:13Z")

</div>

Haha I did something similar with a promicro and pn532.

I’m using the 2nd sector of my [xsiid](https://dangerousthings.com/product/xSIID/) so no issues there. The password was generated by the arduino and written to the memory. Now it’s just read 🙂

Should add that the only problem is I’ve lost the sketch so without a way to read from the promicro I can’t replicate 😅

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [September 30, 2021, 7:22pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/16 "2021-09-30T19:22:29Z")

</div>

This version doesn’t care about where on the chip the password is. It is looking for the header DNGR and then taking the next bit as a password. This could be interesting if someone put DNGR on their chip elsewhere, so perhaps I should make it something less likely. ZPKW perhaps…

If the header isn’t found on the chip anywhere I suppose it could look for a blank space and generate a random password to put in there. That doesn’t allow you to change the password at all though.

---

<div class="post-metadata">

**Author:** ![XEMON](https://forum.dangerousthings.com/letter_avatar_proxy/v4/letter/x/ee7513/32.png) [@XEMON](https://forum.dangerousthings.com/u/XEMON)\
**Post date:** [October 1, 2021, 4:22pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/17 "2021-10-01T16:22:53Z")

</div>

That sounds cool 👍  
Any way to tweak it to read the UID and generate a password from it?  
I’m thinking about this for my work computer, I have to change the pw every 5 weeks (with a bunch of restrictions/limitations) …  
If we can do UID to password conversion, I can enter an NFC UID and not worry about how the chip is programmed …

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [October 1, 2021, 5:44pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/18 "2021-10-01T17:44:10Z")

</div>

Password generation based on a UID would probably generate the same UID (I mean password) every time.

The Trinket can also act as a USB drive, I wonder if I can have it check for a file and if that is created then it programs the chip with that password. You could then run something like pwgen and generate a password and it would program the next chip with that new password. That would allow you to change your password and then program the password into the chip.

---

<div class="post-metadata">

**Author:** ![XEMON](https://forum.dangerousthings.com/letter_avatar_proxy/v4/letter/x/ee7513/32.png) [@XEMON](https://forum.dangerousthings.com/u/XEMON)\
**Post date:** [October 1, 2021, 6:15pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/19 "2021-10-01T18:15:17Z")

</div>

Wow, that’s even fancier than I was thinking 🤔

I was more along the line of “I read UID x so I type password y”  
When you want to change the login password, go in the code, change it and re-upload to the wedge …

---

<div class="post-metadata">

**Author:** ![Zwack](https://forum.dangerousthings.com/user_avatar/forum.dangerousthings.com/zwack/32/12101_2.png) [@Zwack](https://forum.dangerousthings.com/u/Zwack)\
**Post date:** [October 1, 2021, 6:39pm UTC](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642/20 "2021-10-01T18:39:25Z")

</div>

I don’t want people to have to go into the code or reupload it normally. I want this to be as much as possible a consumer product once it is built.

[Next page](https://forum.dangerousthings.com/t/improved-keyboard-wedge/12642.md?page=2)
