Steganography using PIL and NumPy

Steganography is the practice of hiding information in other images, audio, text, … You can add hidden messages to pictures, hide a file within another file, … Here we’ll try to hide some information inside an image. Images are essentially two dimensional lists of pixels, which in turn consist of three integer numbers in the range 0-255 that represent values for red, green and blue. The difference between a pixel with value rgb(230, 129, 200) and rgb(229, 129, 201) are virtually imperceptible. So we can leverage this and hide information in that least significant bits of each pixel. To hide a message in an image a function is needed that converts a string to a binary representation and one that embeds that data in the least significant bits of an image. To reveal the message we need to be able to reverse this, so first a function will extract the least significant bits and the final step is to convert them back into a string. Converting Text to Binary and Back To convert text to binary and back I found a function on StackOverflow though it is a little hard to understand. So let’s dissect the encode_text function step by Read more…

The Sound of Silence: Building a Quiet Mechanical Keyboard

Are you still typing away on a cheap rubber dome keyboard? If so, you might be missing out on the satisfying and efficient experience of using a mechanical keyboard. I鈥檝e been using my own homemade mechanical keyboard for years now, and I can鈥檛 imagine going back. Furthermore, the 60% size is perfect for keeping my mouse close and reducing unnecessary hand movements, but the sound can be a drawback. That鈥檚 why I鈥檝e spent some time exploring quieter options that still deliver the tactile response I love. Keep reading to learn more about how I build a much quieter mechanical keyboard. What makes mechanical keyboards loud? What sets mechanical keyboards apart from their rubber dome counterparts is the use of individual switches for each key. These switches consist of a spring and a stem that, when pressed, complete an electrical circuit and register the keystroke. The result is a tactile and audible response that helps you know when a key has been successfully pressed. Additionally, extra is noise created by the stabilizers under larger keys such as the spacebar and the shift key. These stabilizers are necessary to ensure that these keys depress evenly from all sides, but they add extra Read more…

Secure Design for Low Energy Bluetooth (BLE) Applications

Low Energy Bluetooth (BLE) is widely used in various smart devices and IoT scenarios as a low-power, short-range wireless communication technology. However, due to the characteristics of BLE, it is susceptible to various security threats. Therefore, when designing and developing BLE applications, it is crucial to focus on security issues and implement appropriate security measures to protect communication data and user privacy. Firstly, Security Measures for Bluetooth Pairing In the pairing process between BLE devices, it is essential to use FIPS-approved algorithms such as AES-CMAC and P-256 elliptic curve to ensure the security of pairing information. Pairing information should be stored in a secure storage location on the device to prevent malicious attackers from stealing it. For authentication and encryption, FIPS-approved algorithms should also be used to ensure the confidentiality and integrity of communication data. For example, the use of AES-CCM algorithm can encrypt and protect data transmission, while also ensuring the integrity of messages. In healthcare devices, such as a health wristband communicating with a smartphone, the use of AES-CCM algorithm encrypts the user’s health data to ensure its confidentiality. To prevent passive eavesdropping and man-in-the-middle attacks, user-assisted secure simple pairing methods can be used. For instance, using the Read more…

Zigbee Technology: A Comprehensive Review of its History, Technology, Applications, and Future Directions

Zigbee is a low-power, low-data-rate wireless communication technology that has been gaining popularity in recent years due to its ability to enable wireless communication between devices over short distances. In this article, we will delve into the history of Zigbee, its technology, applications, and future directions, providing a comprehensive review of this exciting technology. History of Zigbee The concept of Zigbee was first introduced in the late 1990s by a group of companies, including Motorola, Intel, and Philips, who formed the Zigbee Alliance. The goal of the alliance was to develop a wireless communication technology that could enable low-power, low-data-rate communication between devices over short distances. The first Zigbee standard, Zigbee 1.0, was released in 2004, followed by subsequent updates, including Zigbee 1.1, Zigbee 1.2, and Zigbee 3.0. Zigbee Technology Zigbee is a wireless communication technology that operates on the 2.4 GHz frequency band, using a mesh networking topology. The technology is designed to enable low-power, low-data-rate communication between devices, making it ideal for applications that require low power consumption and low data transfer rates. Zigbee devices can operate in one of three modes: coordinator, router, and end device. The coordinator is the central device that manages the network, while Read more…

LQ and RSSI in Bluetooth Protocol: Principles and Application Scenarios

In the physical layer of the Bluetooth protocol stack, there are two useful parameters: LQI and RSSI. Both are used by the receiver to evaluate the current wireless environment quality (link quality) and guide subsequent actions. However, the calculation principles and application scenarios of these two values differ significantly. LQI (Link Quality Indication) measures the quality of the received signal. The quality of the received signal is estimated by the receiver by comparing the received signal with the ideal signal and calculating the error accumulation value. For example, when using FSK or GFSK modulation, the receiver can compare the frequency of each bit with the expected frequency and accumulate a certain number of symbols (e.g., 64) to obtain the error accumulation value. Therefore, LQI can relatively reflect the current link quality, and its value is smaller when the link quality is better, and larger when the link quality is worse. RSSI (Received Signal Strength Indication) indicates the signal strength, regardless of the signal quality or correctness. LQI does not care about the actual signal strength, but the signal quality is related to the signal strength, as a stronger signal is less susceptible to interference, resulting in a higher “correctness” rate, Read more…

Printing Abyssal Conspiracy

Both KeyForge Adventures have been out for a while and as I’ve managed to defeat the Keyraken with all my decks it is time to have a look at Abyssal Conspiracy. Preparing cards for printing is done using the same to steps as described in this post. While adding the bleed is exactly the same, extracting the main cards didn’t work. The reason was that the library pdf2jpg didn’t support the newer image compression, JPEG2000, used in that PDF. So this issue has to be fixed first! The files you need to print this adventure can be found here in the Support section under KeyForge Adventures Print-and-Play Materials. All card files need to be processed, the Seal Tableau we’ll turn into a 3D printable token. The Card Pool Location Cards Seal Cards The Tide Card Card Backs or use those from Reddit user Dead-Sync here which already include a bleed and are ready to print The Seal Tableau Tokens to track player positions. You can use anything, but there is a great option on Thingiverse here A copy of the rules Only the file with the card pool uses this new format, other files can be processed exactly as described Read more…

Better code for the MacroPad

A while ago I’ve made a MacroPad and I recently improved the code! In this post I’ll briefly show some advanced code to create a MacroPad class which allows custom functions to be added to key presses using a decorator. The original code as well as instructions how to build one yourself can be found in the original post. Event based library I got the idea for implementing this library from the KeyBow 2040 that implements this specifically for their hardware. This makes the code to actually program their keypad a lot less complex. You can see in the example below, that you simply write the function you want and add @keybow.on_press(key) above the function you want to run when the key is pressed. Let’s see if this can be ported to my MacroPad. # Example code from the KeyBow 2040 GitHub Repo @keybow.on_press(key) def press_handler(key): key.led_on() To achieve this a new library needs to be created that can set up the MacroPad, handle keystrokes and allow you to attach new functions to each key pressed. This is an advanced bit of code, and I won’t go through each part step by step, but it is a great example how Read more…

Bluetooth Mesh Security Overview

The Criticality of Security One of the most discussed issues related to the Internet of Things (IoT) is security. From agriculture to hospitals, from residential smart homes to commercial smart buildings, and from power stations to traffic management systems, IoT systems and technologies will touch many parts of the world we live in. Security breaches in IoT systems could have catastrophic consequences. Bluetooth® mesh networking was designed with security as its number one priority and from the ground up. In this article, you’ll get an overview of the key security features and the security issues addressed. Further articles in the series will examine aspects of Bluetooth mesh networking security in more detail. Security in Bluetooth Mesh Networking is Mandatory Bluetooth® Low Energy (LE) GATT devices may implement a range of security measures as defined in the Bluetooth core specification. It’s the responsibility of the product designer to decide what security measures are required and it’s permissible to decide to adopt none of the available security features at all. In other words, security in Bluetooth Low Energy GATT is optional. This makes sense if we’re talking about the security of a single device and its connection with one other device, provided the product designer Read more…

Fighting Batch Effects with pyComBat

Even high-end scientific equipment can have a bad day! Machine performance can be affected by ambient temperature, humidity, … so when samples are measured in different batches, this needs to be corrected for. In this post we’ll have a look at the Python package pyComBat which does this elegantly and efficiently. Do note that you will need to properly randomize samples across batches. Imagine doing a study with soil samples from two different environments. To be able to correct batch effects you’ll have to make sure half of the samples of each group are in batch one, and the other in batch two. If you put all samples from group one in batch one, the correction will actually remove the differences you are trying to find. Furthermore, there need to be sufficient samples in each batch for this to work. With only a handful of measurements per batch it will not be possible to correct for the effect. Creating a dataset To test what pyComBat can do, a synthetic dataset can be generated with a set of measurements, and a set with a slight deviation that mimics things that can occur when measuring samples at different dates or with different Read more…

Guest Author for TBG!

Recently my post on the analysis of Gwent Pro Rank data was picked up by a member of a Gwent Team, Team Bandit Gang, and they reached out! After pitching some ideas back and forth I ended up doing an analysis on climbing the ladder in Pro Rank. Want to find out if this is skill or grinding games? Head over to their website and read the article I wrote for their website here. If you want to grab a copy of the data and scripts used, head over to the GitHub repository, where you can find all that. There is already some code there that hints towards something I’ve been brewing … stay tuned for more analyses of Gwent Pro Rank data later !