# Implementation of Encryption Using the Finite Field Z2

I am currently exploring the concept of multimedia encryption and have come across the use of the finite field π2 for cryptographic purposes, particularly in the context of homomorphic encryption. I am interested in understanding how to practically implement encryption using this field. this is the paper

subframes in a frame are encrypted with plaintexts β Z2, wherein addition and multiplication are equivalent to binary XOR and AND operations, respectively. For b β Z2, its ciphertext is denoted as [b]. For an integer n, [n] denotes its binary encryption, i.e., encryption of each bit in its binary representation. In our work, BGV is used as the homomorphic encryption.

how can I use Openfhe to implement it?

The question is not very clear to me.

Note you can use binFHE schemes in OpenFHE to do arithmetic in \mathbb{Z}_2 efficiently. Check the examples here.

Also, can you provide a link to the referenced paper?

βYes, I can utilize binary Fully Homomorphic Encryption (binFHE). However, I am concerned that binFHE might not support SIMD operations, which allow for the packing of multiple plaintexts into a single ciphertext. Therefore, I am seeking alternative methods to achieve the desired functionality in Z2.β
the paper DOIοΌ(Decoding Homomorphically Encrypted Flac Audio without Decryption | IEEE Conference Publication | IEEE Xplore)γthis paper use HElib to implement something.

Hi @zgl404,

The Z2 arithmetic can also be supported in BGV and BFV, but this requires the use of non-power-of-two cyclotomics (to support CRT batching). Helib supports this plaintext algebra. OpenFHE currently does not support non-power-of-two cyclotomics at the level of crypto schemes (it only supports it at a lower lattice layer).

There is a also a very recent work that implements Z2 arithmetic in CKKS: Bootstrapping Bits with CKKS

WoW! thatβs so cool! how can i use the new feature in this paperββ Bootstrapping Bits with CKKS (iacr.org)

I have not had a chance to look at this work in more detail yet. I am also not aware of an OpenFHE implementation of it at the moment. We will look into this work a little bit later. If someone has already implemented it in OpenFHE, please chime in