Podcast
Root Causes 235: What Is Lattice-based Cryptography?


Hosted by
Tim Callan
Chief Compliance Officer
Jason Soroko
Fellow
Original broadcast date
July 27, 2022
The recent winners of the NIST post-quantum cryptography contest are strongly focused on lattice-based encryption. In this episode we explain at a high level what this cryptographic approach entails and why lattice-based algorithms fared so well in the NIST search.
Podcast Transcript
Lightly edited for flow and brevity.
But I do think though, that all of us as technical people, perhaps people with math backgrounds, people with just math interests, I think at the absolute very least one of the things that was good about RSA, one of the things that was also good about ECC, is that people were able to at least have an intuitive expression of what’s going on. What makes these things good tough math problems.
And I think that, of course, we’ve said this a few times in this podcast, RSA and ECC are both basically math problems that come under a similar category of the problem of factorization. And you are factoring different things, but they are factorization problems. In other words, classical non-quantum computers cannot solve these kinds of factorization problems in polynomial time, and that’s what makes RSA and ECC really great when you choose a big enough bit length, right, Tim?
Where previously people have been used to the algebraic expressions, the formula. People know what those look like. They are intimidating for non-math people, and they can sometimes be very intimidating to math people. There are levels of difficulty. Everybody has heard E = mc2. Right? A formula. So people are used to that and people certainly in the cryptographic realm are used to seeing algebraic expressions, formulas, that are just pure math that express why a problem is difficult and also, how to break down and solve the problem eventually because, you know, once you have a secret that’s great but once you want to exchange that secret, how do you decrypt something? There are formulas for that as well.
That’s a big takeaway, Tim. That we are moving away from classical formulas and moving towards something that computers really like, which is expressions in matrices. And when you think about a matrix, Tim - - think about a two-dimensional matrix. You know, if anybody has ever looked at an Excel spreadsheet, right, there’s columns and rows and if you were to choose one column and row and another column and row and draw a line between them, that’s called a vector, right?
So, Tim, the reason why I say it’s geometric, more of a geometric based set of problems is because that vector is important to keep in mind. The vector is the expression from one point to another point along that matrix and it points in a direction. There’s an angle to it. There’s a directionality to it and it covers a mathematical space, if you will, and if you are doing it in two and three dimensions, it’s very easy to actually visualize that space in your mind.
So, lattice, if you just think about just that word, we are talking about a matrix. However, the reason why we are choosing the word lattice rather than just matrix is because we are already making hard parameterized decisions about what kind of a matrix we want. And so, therefore, we are talking about integers only. In other words, a matrix can have an infinite number of points in it. You guys who have done linear algebra, you know that. But with lattice-based cryptography, we are choosing to throw away all the infinite number of points between the integer points. So, you know, that sounds very math-y but, again, I think it’s more of a simplification in your mind of – think of a standard two-dimensional matrix and then just think of the integer points, you know, 0, 1, 2, 3, 4, 5. Kind of easy to note. And what’s interesting about that is if you only take the integers and you scale that matrix only by integers, all of the sudden you enter the realm of very tough math problems, and isn’t that interesting?
So, yeah, this is the basis of it, Tim. This is the real basis of, ok, why? Why lattice for cryptography problems? And it’s not matrices, it’s lattice and the only real difference between lattice and all matrices is we are choosing the integers only.
So, how do we make these lattices really tough math problems. Well, here’s another thought for all of you: There are a lot of tough math problems out there, but they’re only tough math problems if you parameterize them correctly and you make the problem large enough. In other words, if we stick with - - I don’t think that there’s any such thing as a two-dimensional or three-dimensional lattice used in cryptography. We are gonna be dealing with N-dimensional lattices. In other words, the one that I can think of in my head very simply is two-dimensional. If you really stretch your head, you can think three-dimensional, but the real stuff is gonna be in very high dimensions. Like 10,000-dimension lattices.
Ok. So, there’s also - - make sure that you also don’t choose a matrix basis, which is really the scale sum of, you know, a couple of factors that you are choosing. Make sure that the basis isn’t too simplistic or is expressed in one of the vectors that you are choosing. In other words, you do have to choose the vectors in your lattice carefully to make sure that they don’t overlap. Just simple mistakes that you shouldn’t make.
And another thing that you really have to do in order to make for tough problems in lattices is you can never allow multiplication by zero to any of the vectors. Otherwise, you just end up at the origin. That’s just too easy to solve.
So, the reason I mention these things, Tim, isn’t - -
So, Tim, I think what’s interesting and the thing I want to get to now is let’s really talk about things that you’ve probably heard about lattice-based cryptography, and I don’t want to make the connection just yet. I think we should do this in a future podcast but, for example, Kyber, right. CRYSTALS-Kyber and Dilithium, both respectively the KEM and Signature algorithms that were chosen to be standardized by NIST, there are many, many forms of tough math problems within lattice cryptography and so, therefore, there are more than one. The ones that were chosen by NIST so far, the two that I just listed, those are in and around the learning with error system of tough math problems. And I’ll describe that in a moment but there are others. There is the shortest vector problem, which is find the shortest non-zero vector in a lattice given the basis of that lattice. And we don’t have to understand fully what that means. I just want you to understand there is more than one math problem within lattice. Shortest vector problems, the closest vector problem, the bounded distance decoding, the covering radius problem and a very popular one, which is, learning with error.
So, let’s go through learning with error without frying our brains.
So, basically, Bob now, right, he now takes two vectors – B1 and B2. These are both public and then he takes a secret vector. I love it; it’s quite often known as S. The secret random vector. Learning with errors is so interesting because there’s also this concept of an error vector and the beauty of these error vectors, and I think in order to be intuitively more interesting to people but thinking about this error vector is that it should be known to everybody playing this game that the error vectors have a magnitude that is very small. In other words, it’s close to the secret vector. And so, I think from here it gets almost a little too math-y except to say - - and again, this is where I’m gonna it a point. Here’s one of your takeaways.
Really what you are trying to do is anybody who is able to figure out (a) you know this public choice of a matrix – I should say a lattice because it is integer based. This randomly chosen matrix I think what you are really trying to solve for is a point on this matrix being asked to find the point on the grid that is close. So, in other words, Alice and Bob have just enough information between each other and the publicly-based information that would be to say, or available to say Eve, she has just enough to know the size of the matrix, where the matrix is, what the bounds and basis of the matrix are. She even knows for a fact that this error point is close to the actual point that’s been chosen as a secret, but the problem is that to actually solve for it even given all that information is actually very, very, very difficult. And this is the learning with errors problem explained extremely poorly without math. Basically, this combination of publicly chosen matrices and publicly given out information about chosen vectors but also secretly chosen vectors that are tough to solve for given what’s publicly available.
So, Tim, isn’t it interesting that a lot of this rhymes with things that we’ve known from the classical world.
You said that there are multiple different lattice-based problems.
So, for those of you looking it up, that’s the level of oversimplification that I’ve just given you. There’s a lot to this.

