Functional encryption for images

ImageFE

Functional encryption for images.

Introduction

In the traditional cryptography framework, a decryptor either recovers the entire plaintext from the ciphertext or recovers nothing. FE allows fine-grained control over the amount of information each specific decryptor can reveal from the ciphertext.

ImageFE adopts a simplified FE scheme. There are two participants, the trusted encryptor and the decryptor. The encryptor i) generates a universal ciphertext from a given plaintext; ii) generates a set of different function keys. The type and amount of information a decryptor can reveal is determined by the function key it receives.

Methodology

Efficient FE only exists for inner products and quadratic polynomials. ImageFE selects several convolution kernels to obfuscate an image. Note that convolution can be considered as a sequence of inner products. Given an original image, ImageFE derives a function key for every convolution kernel. Decrypting with a function key has the same effect as applying the corresponding convolution kernel to the original image. The function key that corresponds to the identity kernel can recover the original image.

Currently, ImageFE uses Decisional Diffie-Hellman (DDH) as the underlying FE algorithm.

Application

Consider the use case of blockchain. The ciphertext can be released to all users. A function key can be protected by public-key encryption schemes widely used by blockchains. The encryption and transmission of function keys to specific users can be triggered automatically by smart contracts. In this way, ImageFE can be naturally integrated with DEFI and NFT.

 

Use ImageFE

Dependency

https://go.dev/doc/install

Building from source

cd imgfe
cd cmd
go build -o imgfe.exe

Usages

The enc command takes an original image and a specification of convolution kernels. It produces the ciphertext and the function keys.

The dec command takes the ciphertext and a function key. It produces an image that is equivalent to the result of applying the corresponding convolution kernel to the original image. Multiple function keys in one mode share the same ciphertext.

Help messages

./imgfe.exe enc -h
./image.exe dec -h

Down resolution mode

downsize_partial yields an image that is scaled down (kernel_offset+1) folds.

downsize_full yields the original image.

./imgfe.exe enc -kernel_type="downsize_partial,downsize_full" 

./imgfe.exe dec -image_file="../workspace/cart_partial.png" -key_file="../workspace/func_key_downsize_partial.json"

./imgfe.exe dec -image_file="../workspace/cart_full.png" -key_file="../workspace/func_key_downsize_full.json"

Blur mode

gaussian_blur and box_blur yield blurred images. Kernel size equals (kernel_offset*2+1).

identity yields the original image.

./imgfe.exe enc -kernel_type="identity,gaussian_blur,box_blur" 

./imgfe.exe dec -image_file="../workspace/cart_gaussian_blur.png" -key_file="../workspace/func_key_gaussian_blur.json"

./imgfe.exe dec -image_file="../workspace/cart_identity.png" -key_file="../workspace/func_key_identity.json"

 

Miscellaneous

Contact

The Dappanomics Lab is founded by Northwestern faculties, alumni and students. We are currently developing DApps surrounding NFT and DEFI. If you are interested in our project, please contact us at you.li at u.northwestern.edu .

Acknowledgements

Dr. Tilen Marc for his kind support.

The FENTEC project.

Similar Resources

Easy to use encryption library for Go

encryptedbox EncryptedBox is an easy to use module for Go that can encrypt or sign any type of data. It is especially useful when you must serialize y

Jul 20, 2022

A tool for secrets management, encryption as a service, and privileged access management

A tool for secrets management, encryption as a service, and privileged access management

Deploy HCP Vault & AWS Transit Gateways via Terraform https://medium.com/hashicorp-engineering/deploying-hcp-vault-using-the-hcp-terraform-provider-5e

Nov 23, 2021

TTAK.KO-12.0223 Lightweight Encryption Algorithm with Galois/Counter Mode (LEA-GCM)

LEACrypt The Lightweight Encryption Algorithm (also known as LEA) is a 128-bit block cipher developed by South Korea in 2013 to provide confidentialit

Dec 16, 2022

Attempts to make attribute based encryption work, particularly trying out bn256 pairing curve

Attempts to make attribute based encryption work, particularly trying out bn256 pairing curve

EC Pairings over bn256 This is an attempt to solve the core problem of attribute based encryption, where the goal is to be able to use CA-issued attri

Jan 5, 2022

Go Encrypt! Is a simple command-line encryption and decryption application using AES-256 GCM.

Go Encrypt! Go Encrypt! is a command-line application used to easily encrypt and decrypt files with the AES-256 GCM encryption algorithm. Usage Usage

Jan 5, 2022

Lattigo: lattice-based multiparty homomorphic encryption library in Go

Lattigo: lattice-based multiparty homomorphic encryption library in Go Lattigo i

Dec 7, 2022

Ubiq-fpe-go - Format preserving encryption in Go

Format Preserving Encryption in Go An implementation of the NIST-approved FF1 an

Oct 19, 2022

Length-preserving encryption algorithm

hctr2 Length-preserving encryption algorithm https://eprint.iacr.org/2021/1441.pdf Security Disclosure This project uses full disclosure. If you find

Nov 15, 2022

Card-encrypt - The encryption code necessary to enroll debit cards in the Palla API

💳 Card RSA Encryption Thank you for choosing Palla! 💸 In this repository you'l

Jul 15, 2022
Related tags
An easy-to-use XChaCha20-encryption wrapper for io.ReadWriteCloser (even lossy UDP) using ECDH key exchange algorithm, ED25519 signatures and Blake3+Poly1305 checksums/message-authentication for Go (golang). Also a multiplexer.

Quick start Prepare keys (on both sides): [ -f ~/.ssh/id_ed25519 ] && [ -f ~/.ssh/id_ed25519.pub ] || ssh-keygen -t ed25519 scp ~/.ssh/id_ed25519.pub

Dec 30, 2022
DERO Homomorphic Encryption Blockchain Protocol
DERO Homomorphic Encryption Blockchain Protocol

Homomorphic encryption is a form of encryption allowing one to perform calculations on encrypted data without decrypting it first. The result of the computation is in an encrypted form, when decrypted the output is the same as if the operations had been performed on the unencrypted data.

Dec 27, 2022
Sekura is an Encryption tool that's heavily inspired by the Rubberhose file system.

It allows for multiple, independent file systems on a single disk whose existence can only be verified if you posses the correct password.

Oct 16, 2022
A document encryption solution for the reMarkable 2 ePaper tablet.

Remarkable 2 Encryption This repository contains multiple tools to encrypt the home folder of the reMarkable 2 epaper tablet using gocryptfs. Detailed

Nov 7, 2022
A super easy file encryption utility written in go and under 800kb
A super easy file encryption utility written in go and under 800kb

filecrypt A super easy to use file encryption utility written in golang âš  Help Wanted on porting filecrypt to other programing languages NOTE: if you

Nov 10, 2022
Encryption Abstraction Layer and Utilities for ratnet

What is Bencrypt? Bencrypt is an abstraction layer for cryptosystems in Go, that lets applications use hybrid cryptosystems without being coupled to t

Nov 9, 2022
Go implementation of the Data At Rest Encryption (DARE) format.

Secure IO Go implementation of the Data At Rest Encryption (DARE) format. Introduction It is a common problem to store data securely - especially on u

Dec 18, 2022
A simple, semantic and developer-friendly golang package for encoding&decoding and encryption&decryption

A simple, semantic and developer-friendly golang package for encoding&decoding and encryption&decryption

Jan 4, 2023
Encryption & Decryption package for golang

encdec Encryption & Decryption package for golang func main() { startingTime := time.Now() privKey, pubKey := GenerateRsaKeyPair() fmt.Println("Priva

Feb 11, 2022
A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

Jan 7, 2023