Why You Should Totally Roll Your Own AES Cryptography

Software developers are usually told to ‘never write your own cryptography’, and there definitely are sufficient examples to be found in the past decades of cases where DIY crypto routines caused real damage. This is also the introduction to [Francis Stokes]’s article on rolling your own crypto system. Even if you understand the mathematics behind a cryptographic system like AES (symmetric encryption), assumptions made by your code, along with side-channel and many other types of attacks, can nullify your efforts.

So then why write an article on doing exactly what you’re told not to do? This is contained in the often forgotten addendum to ‘don’t roll your own crypto’, which is ‘for anything important’. [Francis]’s tutorial on how to implement AES is incredibly informative as an introduction to symmetric key cryptography for software developers, and demonstrates a number of obvious weaknesses users of an AES library may not be aware of.

This then shows the reason why any developer who uses cryptography in some fashion for anything should absolutely roll their own crypto: to take a peek inside what is usually a library’s black box, and to better understand how the mathematical principles behind AES are translated into a real-world system. Additionally it may be very instructive if your goal is to become a security researcher whose day job is to find the flaws in these systems.

Essentially: definitely do try this at home, just keep your DIY crypto away from production servers :)

A VCR with NICAM support.

Remembering NICAM: Deep-Dive Into A Broadcasting Legacy

Although for many the introduction of color television would have seemed to be the pinnacle of analog broadcast television, the 1970s saw the development of stereo audio systems to go with TV broadcasts, including the all-digital NICAM. With NICAM broadcasts having ceased for about a decade now, the studio equipment for encoding and modulating NICAM can now be picked up for cheap. This led [Matthew Millman] to not only buy a stack of Philips NICAM studio gear, but also tear them down and set up a fully working NICAM encoding/decoding system with an Arcam Delta 150 as receiver and Philips PM5687 encoder.

Philips PM5687 with lid off.
Philips PM5687 with lid off.

Finally, the Philips PM5688 test receiver is analyzed. This is the component that studios would have used to ensure that the NICAM encoding and modulating systems were working properly. Although public NICAM broadcasts started in the late 1980s, the system was originally developed to enable point to point transfers of audio data within a transmission system. This was made very easy due to the digital nature of the system, and made enabling it for public broadcasts relatively straightforward once receivers became affordable enough.

Of note is that NICAM was only ever used in Europe and some Asian-Pacific countries, with others using the German Zweikanalton. This was a purely analog (two FM channels) system, and the US opted to use its MTS system, that was quite similar to the German system in terms of transmitting multiple FM channels alongside the TV signal. With digital TV gradually overtaking analog TV transmissions, the future of NICAM, MTS and others was sealed, leaving us with just these time capsules we can build up using old studio equipment.

Ceramic stove (credit: Felix Reimann)

Same Taste With Less Energy: Optimizing The Way We Cook Food

Preparing food is the fourth most energy-intensive activity in a household. While there has been a lot of effort on the first three — space heating, water heating, and electrical appliances — most houses still use stoves and ovens that are not too dissimilar to those from half a century ago.

More recent technologies that make cooking more efficient and pleasant have been developed, such as induction heating. Other well-known and common appliances are secretly power savers: microwaves and electric kettles. In addition, pressure cookers enable the shortening of cooking times, and for those who like dishes that take hours to simmer, vacuum-insulated pans can be a real energy-saver.

Continue reading “Same Taste With Less Energy: Optimizing The Way We Cook Food”

Bare-Metal STM32: Adding An Analog Touch With ADCs

An Analogue to Digital Converter (ADC) is at its core a straight-forward device: by measuring an analog voltage within a set range and converting the measured level to a digital value we can use this measurement value in our code. Through the use of embedded ADCs in microcontrollers we can address many essential use cases, ranging from measuring the setting on a potentiometer, to reading an analog output line on sensors, including the MCU’s internal temperature and voltage sensors.

The ADCs found in STM32 MCUs have a resolution between 12 to 16 bits, with the former being the most common type. An ADC can be configured to reduce this resolution, set a specific sampling speed, and set up a multi-mode configuration depending on the exact ADC peripheral. STM32 MCUs feature at least a single ADC peripheral, while some have multiple. In this article we will take a look at how to configure and use the basic features of the ADCs in STM32 MCUs, specifically the ADCs found in F0 and the ADC5_V1_1 type as found in most F3-family MCUs.

Continue reading “Bare-Metal STM32: Adding An Analog Touch With ADCs”

Grain Stuck In Ukraine: The Fragmented Nature Of Modern-Day Railways

The war in Ukraine has upset the global food market, and the surprising reason is not that Ukrainian wheat isn’t being harvested, but rather that it can’t leave the country. With Russia blockading sea ports, the only way out for Ukrainian grain is by train. And this exposes the long-hidden patchwork of railway tracks and train standards: trains can’t simply cross the border from Ukraine to Poland on their way to a sea port because the tracks don’t match.

Even beyond the obvious issues of connecting differently sized physical railway tracks — the track gauge — there  are different signaling systems, different voltages for electrical trains, different loading and structural gauges, and so on. In Europe today, the political history of the past few hundred years can still be traced back using its railroads, with some parts of the European Union still on 1,520 mm Soviet-standard gauge, rather than the 1,435 mm Standard Gauge, which is also known as Stephenson Gauge, European Gauge, etc.

These complications explain why for example with the current war in Ukraine its railways into the rest of Europe aren’t used more for transporting grain and other cargo: with Ukraine using 1,520 mm gauge, all cargo has to be transferred to different trains at the Ukraine-EU border or have bogies swapped. Although some variable gauge systems exist, these come with their own set of limitations.

In light of this it’s not hard to see why standardizing on a single international or even European track gauge is complicated due to having to replace or adapt all tracks and rolling stock, even before considering the aforementioned voltage and signaling differences. All which may lead one to wonder whether we’ll ever see a solution to this historically grown problem.

Continue reading “Grain Stuck In Ukraine: The Fragmented Nature Of Modern-Day Railways”

Volvo C30 Custom Gauge And CAN Bus Reverse Engineering

With cars being essentially CAN buses on wheels, it’s no wonder that there’s a lot of juicy information about the car’s status zipping about on these buses. The main question is usually how to get access to this information, both in terms of wiring into the relevant CAN bus, and decoding the used (proprietary) protocol. Fortunately for [Alex], decoding the Volvo VIDA protocol used with his Volvo C30 was relatively straightforward, enabling the creation of a custom gauge that displays information like boost pressure and coolant temperature.

The physical interfacing is accomplished via the car’s OBD port, which conveniently provides access to the car’s two (high-speed and low-speed) CAN buses. Hardware of choice is an M2 UTH (Under the Hood) board, sporting a SAM3X Cortex-M3-based MCU, designed for permanent automotive installations. On [Alex]’s GitHub project page it is explained how the protocol works, and which bytes to look for when replicating the project.

Rounding off the project is a round LCD display from 4D Systems that cycles through the status update screens. As a bonus, the dashboard illumination level is also read out in real-time, so the brightness of the display is adjusted to fit this level. All in all a well-rounded project, with interesting prospects for a more permanent integration of the gauge into the dashboard proper.

Continue reading “Volvo C30 Custom Gauge And CAN Bus Reverse Engineering”

How To Make A Difference Through Plant Metabolism

Generally when we consider the many plants around us, we imagine them efficiently using the electromagnetic radiation from the Sun via photosynthesis in their leaves — pulling carbon-dioxide from the air, as well as water from the soil via their roots, and grow as quickly as they reasonably can. In reality, the efficiency of this process is less than 10% of the input energy, and the different types of plant metabolisms that have formed over the course of evolution aren’t all the same.

Among the plant metabolisms in use today, some use significantly more efficient carbon fixation pathways, while others end up wasting a lot of the energy they obtained from photosynthesis with unnecessarily complicated processes, especially to deal with waste. How fast plants can grow if they had all evolved the most efficient carbon fixation pathway has been the subject of a number of studies these past decades, involving everything from crop plants to trees.

As these studies are showing us, more than a scientific and evolutionary biological curiosity, these genetically engineered plants offer real opportunities in everything from food production to reforestation.

Continue reading “How To Make A Difference Through Plant Metabolism”