AES-CMAC on an ATtiny85

[Blancmange] built a custom door chime using an ATtiny85. Unlike most commercial products out there, this one actually tries to be secure, using AES-CMAC for message signing.

The hardware is pretty simple, and a protoboard layout is shown in the image above. It uses the ATtiny85 for control, with an LM380N audio amplifier, and a low cost 315 MHz receiver.

The more impressive part of the build is the firmware. Using AVR assembly, [Blancmange] managed to fit everything into the 8 Kbytes of flash on the ATtiny85. This includes an implementation of AES-CMAC, an AES cypher based message authentication code. The transmitting device signs the request with a key shared between both devices, and the receiver verifies that the message is from a trusted transmitter.

Fortunately, the assembly code is very well commented. If you’ve ever wanted to take a look into some complex ASM assembly, this is a great project to check out. The source code has been released into the public domain, so the rest of us can implement crypto on this cheap microcontroller with much less effort.

Tindie, the Etsy and Yelp for Electronics

For one reason or another, Tindie has become known as the Etsy for DIY electronics, tinkering, and all things that are regularly featured on Hackaday. Now [Emile] over at Tindie is tackling another problem faced by homebrew electronic wizards: finding good middlemen, board houses, places that do assembly, and machinists. The answer to that is Tindie Biz, something that [Emile] is calling the ‘Yelp for electronics.’

[Emile], the owner and creator of Tindie used to work for Yelp, something that got him more than a few “boo”s at last week’s Hackaday Omnibus Launch Party. Despite the community’s inexplicable hatred of Yelp, [Emile] actually learned a lot; verification is the ultimate problem of user-submitted reviews, and his solution to that problem is to put proof of a transaction in with the review, lest Tindie Biz fall into a disarray of spam and astroturfing.

Already there are over 1,400 manufacturers on Tindie Biz, but [Emile] said right now, his new manufacturer review site needs input from DIYers; the real value is in getting people who have done business with manufacturers around the globe to submit reviews. It needs reviewers, and that’s where you come in. It’s all free, and like most good ideas, something that makes you say, ‘I should have thought of that first.’

Hackaday Links: February 8, 2015

[CNLohr] is famous for his extremely strange projects, including something that does something with Minecraft that even he can’t describe. Over the years, he’s built up a vast collection of projects that have been both incredible fails and successes. Here’s a video tour of all those projects.

For this week’s edition “Kickstarter is going insane”, you only need to look at the title of the campaign: Tesla Coils for North Korea.

Last week, a few slow scan TV signals were received from the International Space Station. Here’s the reddit thread.

The worst thing about using an Arduino in a semi-professional environment is the IDE. Here’s cuwire, a better IDE.

Wanna see something insane? How about an SSH library written in x64 assembly?

Radio Shack is in its death throes, and since you haven’t gone in the last few years, you might as well head out one last time and pick up some items on clearance. Here’s the list of store closings (PDF) and all 1,784 stores slated to be closed plotted on Google Maps.

Writing A Virtual Machine In Excel

[Ádám] participates in a competition called KöMaL. It’s a 9-times-a-month journal for junior high and high school students featuring math and physics problems. [Paul Erdős], one of the most published mathematicians of all time, was a huge participant and by far the most notable student to crack open a copy of KöMaL in its hundred-year history. [Ádám] was trying his hand at a problem in Excel, but the official rules prohibit the use of Excel macros. In a daze, he came up with one of the most clever uses of Excel: building an assembly interpreter with the most popular spreadsheet program.

This is a virtual Harvard architecture machine without writable RAM; the stack is only lots and lots of IFs.  The instructions – mostly load, MOV, JNZ, INC, and CMP solves this problem, examining two inputs to see if they multiples of each other. If you’re wondering, an example cell from [Ádám]’s Excel sheet looks like this:

=F6
   INDEX($C$2:$C99999,$G2,1),
   IF(AND(INDEX($B$2:$B99999,$G2,1)="JZ",$I2=0),
      INDEX($C$2:$C99999,$G2,1),
         IF(AND(INDEX($B$2:$B99999,$G2,1)="JNZ",$I2<>0),
         INDEX($C$2:$C99999,$G2,1),
         G2+1
         )
      )
   )
)

[Ádám] has provided his Excel solution to the problem, available on the hackaday.io. It’s in Hungarian which really shouldn’t matter since it’s basically Excel and a pseudo-x86 instruction set. but the column labels will require a bit of Google Translate.

Programming Pi Games With Bare Metal Assembly

pifoxWhile the most common use for a Raspberry Pi is probably a media center PC or retro game emulator, the Pi was designed as an educational computer meant to be an easy-to-use system in the hands of millions of students. Team 28 at Imperial College London certainly living up to the Raspberry Pi Foundation’s expectations with their bare metal assembly clone of Star Fox, aptly titled PiFox.

This isn’t the first time a college course has taken up the task of developing software for the Pi without an operating system; a few years ago, Cambridge University started that off with a series of bare metal tutorials for the Pi that included drawing graphics on the screen and playing around with USB keyboards. PiFox greatly expands on what those early tutorials could do, reading an NES joystick from the GPIO pins, sound with DMA, and rendering 3D objects.

If you’d like to build PiFox for yourself, or better yet, expand on the existing build, all the code is up on Github. There’s also a Raspberry Pi emulator for Linux, just in case you have an ARM assembly bug you just can’t scratch with a Raspberry Pi.

Continue reading “Programming Pi Games With Bare Metal Assembly”

Retrotechtacular: The Magic of Making Cars in the ’30s

retrotechtacular-manufacturing-chevrolet

We usually shy away from calling things ‘magic’ in our features because, you know… science. But in the case of this Chevrolet manufacturing reel from 1936 the presentation is nothing short of an industrialized version of The Sorcerer’s Apprentice. Well, not in the sense of mischief, but in that there is almost no explanation and the way the footage is laced together you get the strong feeling that, at the time, this type of industrialization was magic; a modern marvel. The techniques and skills of each worked passed down from a master to an apprentice but virtually unknown to the general public.

The clip, which is also embedded below, starts off in the machine shop where mold makers are getting ready to go into assembly line production. From there it’s off to the foundry for part casting and then into the stamping plant where white-hot (perhaps red-hot, but black and white film) metal is shaped by man-mangling presses. The image above follows the cast, stamped, and machined parts onto the assembly line. We like seeing a room full of pistons being QA checked by hand using a width gauge and micrometer.  The film continues through to the finished vehicle and we think you’ll agree there’s more than enough voyeuristic video here to overcome that lack of narration.

Continue reading “Retrotechtacular: The Magic of Making Cars in the ’30s”

Learning Assembly with a Web Based Assembler

AssemblyOnlineVery few people know assembly. [Luto] seeks to make learning assembly just a little bit easier with his “fully functional web-based assembler development environment, including a real assembler, emulator and debugger.”

These days, you can be a microcontroller expert without knowing a thing about assembly. While you don’t NEED to know assembly, it actually can help you understand quite a bit about embedded programming and how your C code actually works. Writing a small part of your code in assembly can reduce code size and speed things up quite a bit. It also can result in some very cool projects, such as using Java to program microcontrollers.

With high quality example code, it is very easy to get started learning assembly. The emulator consists of a microcontroller with 32 registers, hooked up to three LEDs, two buttons, and a potentiometer. This is way better than painfully learning assembly on real hardware. Be sure to check out the online demo! Being able to step through each line of code and clearly see the result help make assembly easier to use and understand. It would be great to see this kind of tool widely adopted in engineering programs.

Have you used assembly in any of your projects? Let us know how it went and why you choose to use assembly