EIM-TRNG: Obfuscating Deep Neural Network Weights with Encoding-in-Memory True Random Number Generator via RowHammer
Ranyang Zhou, Abeer Matar A. Almalky, Gamana Aragonda, Sabbir Ahmed, Filip Roth Trønnes-Christensen, Adnan Siraj Rakin, Shaahin Angizi · 2025
Read EIM-TRNG: Obfuscating Deep Neural Network Weights with Encoding-in-Memory True Random Number Generator via RowHammer by Ranyang Zhou, Abeer Matar A. Almalky, Gamana Aragonda, Sabbir Ahmed, Filip Roth Trønnes-Christensen, Adnan Siraj Rakin, Shaahin Angizi (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-02206.txt.
Introduction
Ranyang Zhou and co-authors build a true random number generator inside computer memory and use it to hide the weights of neural networks. Random numbers underpin hardware security, but software generators can be predicted. Their design exploits RowHammer, a memory fault where rapid access to one row flips bits in nearby rows. Controlled carefully, those flips supply genuine randomness at low cost.
The team shows the flips can serve as a steady source of entropy. They then encode network weights with a mix of fixed and random flips. A key drawn from the flip behavior lets owners decode the model later. This keeps the data private and proves the model is genuine. The authors argue the approach offers strong, cheap hardware security and a fresh direction for guarding machine learning models where they run.
Catalog record
| CREATOR | Ranyang Zhou, Abeer Matar A. Almalky, Gamana Aragonda, Sabbir Ahmed, Filip Roth Trønnes-Christensen, Adnan Siraj Rakin, Shaahin Angizi |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 44 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2507-02206
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
EIM-TRNG: Obfuscating Deep Neural Network Weights with Encoding-in-Memory True Random Number Generator via RowHammer Ranyang Zhou, Abeer Matar A. Almalky, Gamana Aragonda, Sabbir Ahmed, Filip Roth Trønnes-Christensen, Adnan Siraj Rakin, Shaahin Angizi Abstract True Random Number Generators (TRNGs) play a fundamental role in hardware security, cryptographic systems, and data protection. In the context of Deep Neural Networks (DNNs), safeguarding model parameters—particularly weights—is critical to ensure the integrity, privacy, and intellectual property of AI systems. While software-based pseudo-random number generators are widely used, they lack the unpredictability and resilience offered by hardware-based TRNGs. In this work, we propose a novel and robust Encoding-in-Memory TRNG called EIM-TRNG that leverages the inherent physical randomness in DRAM cell behavior, particularly under RowHammer-induced disturbances, for the first time. We demonstrate how the unpredictable bit-flips generated through carefully controlled RowHammer operations can be harnessed as a reliable entropy source. Furthermore, we apply this TRNG framework to secure DNN weight data by encoding via a combination of fixed and unpredictable bit-flips. The encrypted data is later decrypted using a key derived from the probabilistic flip behavior, ensuring both data confidentiality and model authenticity. Our results validate the effectiveness of DRAM-based entropy extraction for robust, low-cost hardware security and offer a promising direction for protecting machine learning models at the hardware level. I Introduction Recently, DNNs have emerged as a popular solution to perform a wide range of real-world tasks, including but not limited to language processing and vision [ 1 ] . Training these large-scale DNN models requires an enormous amount of training resources and financial support, making them an important intellectual property (IP) for the model developer. In addition, protecting model parameters improves their security, as prior works have shown that having access to model architecture and weights allows an adversary to launch strong white-box attacks on leaked DNN model [ 2 , 3 , 4 ] . Hence, protecting internal model information, such as topology and weights, is critical to protect both financial and security losses for model developers. TRNGs play a critical role in protecting the privacy of DNNs [ 5 , 6 , 7 ] , especially in scenarios where model parameters need to be stored or transmitted securely. Randomness is fundamental to cryptographic protocols and privacy-preserving techniques, such as secure multiparty computation and watermarking [ 8 , 9 ] , which rely on non-deterministic keys or initialization vectors to prevent reverse engineering, model piracy, or unauthorized inference. While Pseudo-Random Number Generators (PRNGs) can generate sequences that appear random, they are ultimately deterministic and vulnerable to attacks if the initial seed or algorithm is known. In contrast, TRNGs derive randomness from physical entropy sources, ensuring unpredictability and robustness against such threats. However, generating high-quality TRNs in hardware is a non-trivial task [ 10 ] . Conventional TRNGs often rely on specialized circuits to exploit sources such as thermal noise, metastability, or jitter [ 11 , 12 ] . These approaches, while effective, typically demand custom circuitry, increasing design complexity and hardware cost, and are not always feasible for deployment in commodity devices. To address these limitations, researchers have explored DRAM as an alternative entropy source due to its ubiquity, low cost, and physical behavior that can be exploited without hardware modification. Several notable efforts in this direction include DRNG, DTRNG, FracDRAM, and QUAC-TRNG [ 13 , 14 , 15 , 16 ] . DRNG [ 13 ] utilizes unpredictable startup values of DRAM cells. Upon powering up, DRAM cells show random values due to floating bitlines and manufacturing variations. DTRNG [ 14 ] introduces randomness by performing weak write operations, applying reduced wordline (WL) voltage to generate partial charge transfers. This results in varied output due to process noise, and it requires no hardware changes. FracDRAM [ 15 ] introduces the Frac operation, a sequence of Activate ( ACT ) and Precharge ( PRE ) commands to leave the cells in a metastable voltage state near \frac{V_{DD}}{2} . This uncertainty is then sampled by the sense amplifiers, yielding random results. Similarly, QUAC-TRNG [ 16 ] leverages a QUAC operation to activate and interrupt multiple rows simultaneously, inducing charge sharing and generating unpredictable voltages that produce random bit values after sensing. Despite these advancements, most DRAM-based TRNGs are designed for continuous randomness extraction or entropy pooling [ 12 , 11 , 17 ] . In this work, we explore a different direction by leveraging DRAM behavior to generate a one-time-use key suitable for encrypting a memory page. This is particularly useful for secure watermarking or encrypting the weights of a DNN model in a way that ensures confidentiality and traceability, while still enabling recovery by authorized users. To achieve this, we propose EIM-TRNG , a novel Encoding-in-Memory TRNG that exploits the RowHammer vulnerability in DRAM. RowHammer is traditionally considered a security threat, where repeated activation of an aggressor row causes unintended bit-flips in adjacent victim rows due to charge leakage and cell-to-cell interference [ 18 , 19 ] . However, we repurpose this phenomenon for privacy. Due to variations in temperature, process nodes, and electronic noise, the exact location and frequency of RowHammer-induced bit-flips are inherently unpredictable, especially under controlled hammering conditions. Once the sense amplifier samples cells near \frac{V_{DD}}{2} , the outcomes are affected by thermal noise and become truly random. EIM-TRNG applies a fixed number of RowHammer cycles, i.e., Hammer Counts (HC), to targeted memory rows. After hammering, the affected page contains a mix of fixed and random bit-flips. By extracting these unpredictable flips as a randomness source, we effectively generate a one-time-use encryption key. The original page and its encrypted counterpart can then be shuffled, and the extracted flip locations stored securely as a decryption key. Our framework provides three major advantages: (1) high security through physically unclonable randomness, (2) no hardware modification since the mechanism exploits existing DRAM behavior, and (3) ease of implementation using common DRAM testing frameworks. This approach provides a one-time, high-entropy solution for model protection, offering a compelling new application of RowHammer: transforming a vulnerability into a tool for enhancing DNN privacy. The key contributions of this paper are as follows. (1) We propose a new TRNG mechanism which provides high-quality randomness derived from physical DRAM behavior, ensuring cryptographic-grade security through inherently unpredictable RowHammer-induced bit-flips. (2) We propose EIM-TRNG which requires no additional hardware modification, making it readily deployable in commodity DRAM chips. (3) We perform extensive experimental characterization and analysis on real DDR4 DRAM modules, rigorously evaluating the security, robustness, and randomness quality of the proposed EIM-TRNG approach under realistic operational conditions. II Background & Motivation DRAM Architecture. A DRAM chip consists of a two-dimensional array of memory cells, structured into smaller segments known as mats within each bank. Contemporary DRAM modules incorporate billions of such cells [ 20 , 21 ] . Each individual bit-cell, as shown in Fig. 4 , comprises a capacitor and an access transistor, where binary data is encoded based on the capacitor’s charge state: a fully charged capacitor represents a logic “1” while a discharged capacitor corresponds to a logic “0” [ 22 , 23 ] . Fig. 1: Organization of a DRAM chip. DRAM Timing Constraints. The fundamental timing parameter in DRAM is the clock cycle ( t_{CK}