FLOE: Random-Access AEAD for Fast Lightweight Online Encryption

Microsoft Research

Snowflake's Greg Rubin presents FLOE, a FIPS-friendly way to encrypt huge files in chunks

In a Microsoft Research cryptography talk, Snowflake engineer Greg Rubin described FLOE, a random-access authenticated encryption scheme built to avoid the memory blowup of AES-GCM on very large files. His laptop benchmarks showed decryption of a 1 GB file dropping from 90 seconds and 16 GB of memory to about the same cost as encryption.

Greg Rubin, a software engineer at Snowflake, presented FLOE (Fast Lightweight Online Encryption) to Microsoft Research's cryptography talk series. FLOE is a new authenticated encryption scheme for large objects that can be encrypted and decrypted in constant memory, in any segment order, while staying within FIPS 140-3 rules. Rubin built it with Andres Fabrega, Julia Len and Thomas Ristenpart, and said the public spec is on GitHub with reference implementations in four languages.

The problem: AES-GCM runs out of memory on big files

The work began when an internal Snowflake team was told to protect a very large file with AES-GCM and ran out of memory. Rubin explained that authenticated encryption must check the whole ciphertext before it releases any plaintext, so a 10 GB file needs roughly 20 GB of memory to decrypt. Encryption is fine; decryption is the issue.

The obvious fix, splitting the file into independent encrypted segments, is not secure. An attacker can swap, delete or truncate segments, turning "I like apples but not cake" into "I like cake but not apples". Existing designs such as STREAM and Tink streaming close that hole by putting the segment number in the initialization vector (IV). Rubin said that makes the IVs non-random, which breaks FIPS compliance, and that random-access encryption was left an open question.

How FLOE is built

FLOE moves the segment position out of the IV and into the associated data, so IVs can be truly random again. It adds a ciphertext header holding a random IV, the scheme's parameters and an integrity tag. It also derives a fresh key for every group of 2 to the 20 segments using HKDF expand, which lets one top-level key cover exabytes of data and works around the limit on random 96-bit GCM nonces. Segment length is the only parameter developers can set.

A presentation slide showing the structure of the FLOE encryption scheme with header and segments.
The FLOE design: segments with random IVs, a ciphertext header, and a key schedule for each group of segments.

The header tag makes FLOE committing: a ciphertext can decrypt to only one key, nonce and associated-data combination. Rubin said earlier streaming schemes inherit the weakness of non-committing ciphers such as AES-GCM. The design also aims to stay safe if a developer reuses a key with another algorithm, though he noted that proof was cut from the paper and has not been peer reviewed.

New security definitions and safe error messages

The team defined random-access authenticated encryption, with segment position as an explicit input, and a matching real-or-random security notion. They showed it is strictly stronger than the earlier NOAE2 notion by building a scheme with a trapdoor that is secure for in-order encryption but breaks when segments are encrypted out of order. Existing schemes remain secure under the new definition.

Rubin singled out error messages as a design feature. FLOE defines a fixed set of distinct errors and the paper proves they leak nothing an attacker could not already know, a framework he said can be applied to real platform APIs. He said this drew pushback online, including from Reddit commenters who objected to him designing cryptography.

Limits and performance

FLOE is write once. Allowing rewrites invites rollback attacks, where an attacker splices old and new segments into a ciphertext the author never produced. Rubin said every fix he has found, such as Merkle trees or transactions, has heavy costs, and he invited researchers to work on it.

A slide showing timing results for encrypting and decrypting a large file with FLOE and AES-GCM.
Benchmark results comparing sequential and random-access FLOE transfers of a 10 GB file.

On his laptop with a 1 GB file in Java, encryption took about 13 seconds for both AES-GCM and FLOE. Decryption took 90 seconds and 16 GB with AES-GCM, but about the same time and memory as encryption with FLOE. With a 10 GB file moved to cloud storage, multi-threaded random-access FLOE took about a minute and a half against three and a half minutes sequentially, saturating a 1 Gbit/s network. He said FLOE's overhead was hard to measure next to TLS.

Questions and answers

What is FLOE, the encryption scheme Snowflake's Greg Rubin presented in 2025?

FLOE (Fast Lightweight Online Encryption) is a random-access authenticated encryption scheme for large objects. Snowflake software engineer Greg Rubin presented it to Microsoft Research's cryptography talk series. It encrypts and decrypts in constant memory, in any segment order, while staying within FIPS 140-3 rules.

Why did Snowflake create FLOE to replace AES-GCM for large files?

Snowflake created FLOE because AES-GCM ran out of memory on a very large file. Authenticated encryption must check the whole ciphertext before releasing any plaintext, so decrypting a 10 GB file needs roughly 20 GB of memory. Encryption is fine, but decryption is the problem.

How much faster is FLOE than AES-GCM at decrypting a 1 GB file?

On Greg Rubin's laptop with a 1 GB file in Java, AES-GCM decryption took 90 seconds and 16 GB of memory. FLOE decryption took about the same time and memory as encryption. Encryption took about 13 seconds for both AES-GCM and FLOE.

How does FLOE stay FIPS compliant when other streaming encryption designs do not?

FLOE moves the segment position out of the initialization vector and into the associated data, so IVs can be truly random. Greg Rubin said STREAM and Tink streaming put the segment number in the IV, making IVs non-random and breaking FIPS compliance. FLOE also derives a fresh key for every group of 2 to the 20 segments.

What are the limits of Snowflake's FLOE encryption scheme?

FLOE is write once. Greg Rubin said allowing rewrites invites rollback attacks, where an attacker splices old and new segments into a ciphertext the author never produced. He said every fix he has found, such as Merkle trees or transactions, has heavy costs, and he invited researchers to work on it.

How did FLOE perform on a 10 GB file moved to cloud storage?

Multi-threaded random-access FLOE took about a minute and a half to move a 10 GB file to cloud storage, against three and a half minutes sequentially. Greg Rubin said it saturated a 1 Gbit/s network. He also said FLOE's overhead was hard to measure next to TLS.

From the YouTube description

A ubiquitous problem in large-scale production environments is online encryption of large messages (e.g., databases, video streams, etc.), that is, encryption while using a small amount of memory. While straightforward when only (unauthenticated) encryption is required---say, by encrypting/decrypting in chunks, using a standard encryption scheme---this is more challenging in the presence of active attackers, who may drop or reorganize ciphertext segments arbitrarily. Moreover, many uses cases additionally require both encryption and decryption to be random access, meaning that messages (resp., ciphertexts) can be encrypted (resp., decrypted) in any order.

The purpose of this talk is to present the design of FLOE (Fast Lightweight Online Encryption), a new random-access online AEAD scheme. FLOE was designed in close collaboration with Snowflake, a leading cloud company, where it is slated to be deployed in production to protect sensitive user data. Requiring online encryption of large files, Snowflake encountered a number of real-world challenges with existing schemes, which motivate the design of a new construction.

Speaker: Greg Rubin

Speaker bio: Greg Rubin has been working in the intersection of software development, computer security, and cryptography for the past 20 years. He focuses on the challenges of deployed cryptography at "cloud-scale" and starts really having fun once data crosses the trillions of objects and petabytes of data. Now he works for Snowflake, helping them to secure the AI Data Cloud.

Beyond just the technical, he focuses on being a "cryptography translator" or someone who can explain complicated cryptographic concepts to any group. This skill has been put to use countless times through internal trainings, talks, or helping different groups and companies to collaborate. Beyond the workplace, he's also a skilled storyteller and has performed before hundreds of people.

Watch on YouTube

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.