International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems 2025

pracy:

A Practical Compiler for Attribute-Based Encryption in Python


Sven Argo
Ruhr-University Bochum, Bochum, Germany

Marloes Venema
University of Wuppertal, Wuppertal, Germany

Adrian Ackermann
University of Wuppertal, Wuppertal, Germany

Tim Güneysu
Ruhr-University Bochum, Bochum, Germany; Deutsches Forschungszentrum für künstliche Intelligenz, Bremen, Germany


Keywords: attribute-based encryption, implementation, compiler, automation


Abstract

Attribute-based encryption (ABE) is a versatile primitive that has been considered in many applications to enforce access control cryptographically. To actually benefit from ABE in practice, we require implementations of schemes that satisfy all the properties that are needed. Many theoretical advancements have been made to attain such properties, ultimately resulting in powerful abstractions such as pair encodings. To build an ABE scheme, we use a compiler (in the theoretical sense), which transforms a provably secure pair encoding scheme into a provably secure ABE scheme. Although several such compilers have been introduced, they all abstract away many details that are relevant for engineers, which can hinder the implementation of schemes in practice.To address this problem, we propose pracy, which is a tool that automatically implements an ABE scheme from an input pair encoding scheme. To achieve this, we first note that we need to overcome a general issue in any automation efforts – including automated optimization and security analysis – in the field of pairing-based cryptography. In particular, there exist no parsers that properly model the interaction between the predicate and the pair encodings. Therefore, we devise a new formal model and type system, which capture this interaction in a way that is compatible with automated implementation efforts. To illustrate the feasibility of our model and system, we construct pracy, which is a (practical) compiler in Python that can implement ABE schemes in multiple target programming languages such as Python and C/C++. With pracy, we not only make the implementation of ABE schemes from pair encodings more accessible to practitioners, we realize the potential that pair encodings have to simplify implementation efforts.

Publication

IACR Transactions on Cryptographic Hardware and Embedded Systems, Volume 2025, Issue 4

Paper

Artifact

Artifact number
tches/2025/a38

Artifact published
January 30, 2026

Badge
IACR CHES Artifacts Functional

README

ZIP (270954 bytes)  

View on Github

License

Note that license information is supplied by the authors and has not been confirmed by the IACR.


BibTeX How to cite

Sven Argo, Marloes Venema, Adrian Ackermann, Tim Güneysu. (2025). pracy: A Practical Compiler for Attribute-Based Encryption in Python. IACR Transactions on Cryptographic Hardware and Embedded Systems, 2025(4), 46–91. https://doi.org/10.46586/tches.v2025.i4.46-91. Artifact at https://artifacts.iacr.org/tches/2025/a38.