What is Functional Encryption?
Tags: Security, Encryption, Cybersecurity, Python, Trump

Photo by Markus Spiske on Unsplash

First, let’s talk about physical encryption.

For the purposes of this article, we are calling “physical encryption” the process of encrypting information in such a way that it can be decrypted.

The physical encryption process comes from this library, in case you wanted to give this a whirl. There’s no source here but you can feel free to spend some time reverse-engineering whatever source you may wish to use because you can do this with Python and it’s easy enough albeit perhaps not all that useful.

So what is functional encryption, anyway?

For the purposes of this article, we are defining “functional encryption” to be any process one can code as a function that tends to modify the information using some kind of technique or through the use of a number of techniques.

The rather simplistic functional encryption technique we are using here is a simple fold and a single fold.

The interesting thing about folding data is there is no crease.

When you fold a physical piece of paper there is a crease and the fold can be easily reversed or unfolded.

When you fold data there is no obvious observable crease one might use to reverse the process. This is the power of functional encryption. There is nothing one might observe to guide the reverse of the process.

So what happens when you fold encrypted data and then you try unencrypting the folded data? Nothing happens other than an error.

For the purposes of encryption, which is a highly mathematical process, when you fold the encrypted data you are creating a deformation or corruption of the data using a function you know about others may not know about.

Even when a hacker has your key(s) and they know you used Twofish they will not be able to decrypt your data unless they know how the data was corrupted assuming you use functional encryption to purposefully corrupt your own data.

This sounds like a crazy idea.

Photo by Tengyart on Unsplash

Yes, this sounds like a crazy idea but everyone loves a crazy idea that works.

Every bit of human progress began as a crazy idea that worked.

Electricity was a crazy idea when it was discovered in the form of static electricity and it was viewed as a parlor trick until someone else learned how to transmit and store electricity and then it became the electric grid none of us wants to live without.

Functional encryption may seem like a crazy idea until someone learns it can be useful and then it will suddenly become a great idea.

I give you the encryption keys.

Photo by Jozsef Hocza on Unsplash

I assume hackers will get my encryption keys especially because I have to store them somewhere. Hackers will get into your networks, they will. There is nothing you can do about this. Network Security is a myth. There will always be holes in every network no matter how much money you spend to plug them. Accept this as a given and stop spending money on this type of security. Yes, use firewalls. Yes, use CIDR blocks. Yes, use SSL. Yes, do all this because it costs nothing but a bit of your time to set it up.

I use an encryption scheme that stores the keys in the encrypted data. I give you the keys. This too sounds like a crazy idea, doesn’t it? Of course, it does. But keep reading.

You do not know what my keys look like because this too is a form of functional encryption. Reverse-engineer the source and maybe you get to learn this detail. Maybe. Until it changes.

You do not get to know where I put my keys. Keep looking at the Python byte codes, if you wish.

Because my keys are randomly generated and stored with the encrypted data there is no need to store the keys where someone might find them. There is no need to write down the passphrase where someone might find it sticking to a computer screen. In essence, there are no keys. There is only data.

Functional encryption…

Functional encryption allows us to build a library of functions we can use to further corrupt the data which means there is no encryption and no keys there is only data.

Can a hacker find all your functions?

Can a hacker spend enough time to reverse-engineer all that high-level code into usable source code that the hacker might use to do the deed? Probably not, and doubly not so unless they are inside my organization which I can assure you they are not.

Now for the code:

Consider the following code: (Available here.)

This code works for me however it may or may not work for you.

The encrypted data is folded once and then it is used as-folded to see if it can be decrypted and of-course it fails.

This is a proof-of-concept to show encrypted information can be obviously manipulated to render it useless through the use of a function to raise the bar on security.

A future article, in this series, will continue to talk about this idea to show additional techniques one might use to help illuminate the concept.

The bottom line is standard techniques are not working and never worked. It is time for a renaissance and I want to be the spark for that movement which may seem crazy now however later some of these ideas may become useful much like the development of our modern electric grids.