S7 Bonus: From Fractional CTO to Seed-Backed Cybersecurity Founder: Implementing Practical Searchable Encryption with Dan Draper of CipherStash [0:00:01] Clip: Dan Draper, CipherStash Founder, CipherStash.com [0:00:02] Dan Draper: The first product took many goes to get right. I think I had four or five attempts at it before I got it working. It was in part me understanding kind of the sharp edges of the problem, but also just trying to find technologies that were going to help me solve it. There are probably three main dimensions that we still think about today, and I certainly thought about in the early stages. Security being the obvious one, performance, And the final trade-off is what kinds of search capabilities can you make? My name is Dan Draper. I'm the CEO and co-founder at CipherStash. [0:00:47] Noah Labhart: This is Code Story, a podcast bringing you interviews with tech visionaries who share in the critical moments of what it takes to change an industry and build and lead a team that has your back. I'm your host, Noah Labhart, and today how Dan Draper created a way for you to encrypt your data and enable blazing fast search. All this and more on Code Story. Dan Draper is from South Australia, specifically Adelaide, but his family now lives in Sydney. He does not drink Foster's beer, which is not surprising, and doesn't know what a Bloomin' Onion is. Outside of tech, he's been a lifelong martial artist. He finds that there's an overlap between coding and martial arts, as they are very technical, require a lot of solo focus, and, jokingly, you have to be ready to take a beating. Five years ago, Dan got the idea of his current venture while he was a CTO at Expert360. He was approached by his clients as they demanded proof of how his organization was protecting their data. He was never fully satisfied with the answers they gave those clients. He desired to bridge the worlds between encrypted data and queryable information. This is the creation story of CipherStash. [0:02:12] Dan Draper: CipherStash, we think of it as the solution to the final reason why a developer wouldn't use encryption in their application. So let's unpack that. application level encryption or field level encryption as we call it is one of the best ways to protect data in an application not talking about you know encryption at rest encrypting the file system i'm talking about encrypting records in a database column with keys that only your application knows now that's a great piece of technology there's plenty of open source libraries that do that the challenge of course is when you implement field level encryption, you lose a whole swag of capabilities. So for example, Ruby on Rails in version 7 introduced this idea of active record encryption, which does that for active record models. If I was to use that technology to encrypt, say, an email address or somebody's name or date of birth, I can no longer do queries on those fields. So if I wanted to look up somebody by their email address or part of their email address, like a partial text match search, or I wanted to order people by their first name on a dashboard or something like that. None of those queries are possible anymore. And so CipherStash is the solution to that. CipherStash is what we call a searchable encrypted index that sits on top of your existing application and database and provides a way for you to index your encrypted data using an encrypted index so that you can perform encrypted searches of your data. It's very fast. It's very easy to add to your application. And we find it is really that removes the final blocker for developers using encryption in their applications. CipherStash, or the idea for CipherStash, was born a few years ago. I've been working on this problem for about five years now. When I was the CTO for an organization here in Australia called Expert360, we were selling to large corporates, some of the biggest companies in Australia. They were asking us to prove to them how we were protecting their data. the data that they were giving us responsibility for. And frankly I was never fully satisfied with the answers that we were giving and it was certainly not a reflection of the team or the company, it was more a reflection of the available technology. We wanted to be able to encrypt this data but as soon as we did that we were not able to query it, we weren't able to implement encryption and retain application functionality that we needed. And so this sparked the journey for me, I went and studied at Stanford, I did their graduate I found some researchers. One paper in particular that sparked a lot of interest for me was from some researchers at Stanford in 2016. They published a paper called Order Revealing Encryption, which was a really interesting new form of searchable encryption technology. It was very, very difficult to apply to traditional databases. And so I spent the next three years trying to work out how to apply that to a B-tree or an inverted index. And eventually in 2020, I came up with a working prototype, raised some funds off the back of that prototype. Now I'm very fortunate to have an incredible team around me and together we're building out the platform that is now known as CipherStash. [0:05:31] Noah Labhart: Tell me about the MVP. How long did it take you to build and what sort of tools did you use to bring it to life, that first product you built? [0:05:40] Dan Draper: The first product took many goes to get right. four or five attempts at it before I got it working. It was in part me understanding kind of the sharp edges of the problem but also just trying to find technologies that were going to help me solve it. The technology that I ended up using for the prototype was originally based on PostgreSQL as a database. I wrote a bunch of custom extensions or plugins for Postgres written in C. The underlying cryptography library was originally written in C, nowadays it's written in Rust. And I added a bunch of application layers on top of that, and they were all written in Elixir. Writing a high-performance data service, many of the characteristics of Elixir and the Beam virtual machine made sense for this kind of problem. Supervision trees and high availability and so forth. We're gradually moving more and more of that code to Rust, but certainly in the early days, Elixir and C were my go-to tools. [0:06:42] Noah Labhart: When building an MVP, you got to make certain decisions and trade-offs around, you know, tech debt or feature cut or scope, you know, minimization. What's that? What's the, you know, the most impactful thing we can build in the beginning and how fast can we build it? Tell me about some of those decisions and trade-offs you had to make and how you coped with those decisions. [0:07:01] Dan Draper: I think the interesting one for CipherStash is it is a very clear set of trade-offs. there are probably three main dimensions that we still think about today and I certainly thought about in the early stages security being the obvious one you know how secure is it what trade-offs are you making that might reduce security or improve security performance sometimes we think of security and performance being at odds with each other and certainly that is true in most systems and it is true in CipherStash as well to an extent and then the final trade-off is what capabilities can you make? How accurate is your free text search? Can you do range queries? Can you do joins and grouping and all those kinds of things? And so I was looking at all three of these dimensions and trying to find the fastest way to build something that was pretty fast, as secure as I could make it, and supported a number of different query operations. [0:07:59] Noah Labhart: Okay, so from that point, you've got your MVP, you've made your decisions, and it's working. the product or how did you progress the product from there and how have you matured it and i'm curious how you built your roadmap and decided okay this is the next most important thing to build or address was for CipherStash. I think [0:08:19] Dan Draper: one of the hardest parts of building our roadmap was that a lot of the features and capabilities that we wanted to include in the product we weren't even sure if they were possible so a lot of a lot of the work we've done has been highly r&d focused you know Our free text search worked really well. You could get quite accurate matches. Query performance was great, but ingest performance was abysmal. It took forever to ingest data because it had to do all of this highly complex computation. Part of the R&D focus there was trying to find smarter ways or faster ways that we could ingest the data and still get the same query performance and the same security parameters. parameters. We're also very heavily reliant on customer feedback. How do customers want to use CipherStash within their existing systems? In the early days, we wanted people to use CipherStash as a primary data store. And you can actually still do that. You can still use it as a searchable, simple data store. We realized that most people didn't want to change the technologies that they were using. And so a lot of our roadmap then focused to how do we plug into existing systems? Do we want to plug into Ruby on Rails? Do we want to plug into Node.js? Now we're talking about plugging into Golang, Docker containers, a sidecar for Kubernetes. There's so many different ways that CipherStash could be used within your existing system. How we think about that now is working with customers to find how they want to use CipherStash and then letting that define our roadmap. map. It's very easy to fall into the trap of, we think we know how people want to use it, and so we're going to go and build that. It's so important to go and get the feedback from customers, other developers, and find how they think they'd like to use it and work with them to build that. [0:10:11] Noah Labhart: Let's switch to team then. So how did you go about building your team and what did you look for in those people to indicate that they were the winning horses to join you? [0:10:21] Dan Draper: the team you bring into a an early stage company is it's one of the most important decisions you can make as a founder and i i've been incredibly fortunate to have some amazing people join our team for example uh the first two people that joined um james sadler is our chief technology officer and he's a he's an old friend of mine and we've worked together several times in the past i've been talking to him about this technology what eventually became CipherStash for years and I remember him saying to me one afternoon over a beer, he said, Dan, CipherStash checks all my boxes. How do I get in? So he was very excited about it from a very early stage. And so I was thrilled when he decided to join. And then our chief product officer, a guy by the name of Lindsay Homewood, actually was a former boss of mine. So we worked together a few years ago at an organization here in Australia called the Digital Transformation Agency. I remember going to him and asking him for advice and feedback on the product and we were speaking about it so often I thought to myself one day maybe I should just ask Lindsay if he wants to join the company and I thought he'll probably say no but hey look you miss 100% of the shots you don't take right so let's just ask and he originally said to me oh yeah maybe one day and then a few days later he sent me an email saying maybe we should chat history. He decided that CipherStash was something he wanted to be a part of. And, you know, now is the time. Since then, as all three of us have been in the tech industry here in Australia for many years, we have a great network. And so we actually just hired several of our former teammates. We've built out a really, really stunning team, I would have to say. We've also hired a few new folks that we hadn't worked with before. And I'm proud to say we actually haven't had a great deal of trouble hiring fantastic people as much as a lot of startups do struggle in this space. I think it's because lots of folks really resonate with this problem. It's cool tech. Plus we're using languages like Rust and Elixir and that gets people excited. There are a lot of developers out there that want to use Rust in production that maybe haven't had the opportunity to do so. And so CipherStash is one of the few companies in Australia at least that is hiring for Rust roles. So that's certainly worked in our favor I think. [0:12:43] Noah Labhart: so then let's talk about scalability and you know given given the you know nature of your product it'll be interesting to hear how you approached it so did you build this to scale efficiently from day one or have you been fighting this or are you fighting this as you grow so [0:13:01] Dan Draper: efficiency and performance is one of the first questions we get asked about CipherStash I always knew that it would be a factor. You know, it's actually relatively easy to implement this idea of searchable encryption over a few hundred or a few thousand records. What makes it difficult is how do you do that efficiently for millions or even billions of rows of data? So it was something that I thought about right from the very beginning. And I wanted to try to use the kinds of technologies that search systems or information retrieval systems use already. indexes and b-trees. So the challenge was to find a way to apply searchable encryption, particularly order-revealing encryption, to those kinds of data structures. And so that's really the secret sauce. How we were able to do that is what made CipherStash possible. So the query performance, if you think about algorithmic complexity as an example, it's sublinear. So that means that a query of a million records can take 20 milliseconds, milliseconds and that scales sub-linearly. So if we had to change the amount of data we're querying to 10 million, it doesn't jump to 200 milliseconds, it might be 22 or 23 milliseconds. And so it was incredibly important for us as we designed CipherStash and as I built the prototypes and as the team have continued to develop it, that we always have that scalability factor in mind. It's not an easy thing to achieve, mind you. There's lots of things to consider. you can't fall back on some of the techniques that you would fall back on in an unencrypted setting. You have to think about so many different things in a different way. And that's been a huge challenge, but thankfully one that we've managed to solve and are continuing to improve on to this day. [0:14:47] Noah Labhart: Well, as you step out on the balcony and you look across all that you've built, what are you most proud of? [0:14:54] Dan Draper: It would be easy for me to say the underlying technology for and this sounds like it sounds like a cliche but I'm most proud of the team I've built. I think one of the things that I was afraid of as a founder who was working on you know really quite groundbreaking technology I was afraid that I wasn't going to be able to find people that could take the mantle and run with it. I was afraid that I wasn't going to be able to find people that I could give this technology to and I could step away from and it would would still be successful. I really do feel that if I take a vacation or if I'm focused on sales or raising capital, that they will continue to build this product in a way that is in line with the vision for the company. I'm absolutely thrilled to have this team around me. And the next challenge for us is to continue to grow that team in a way that continues that trend. I think the team is the thing that I'm most proud of. [0:15:54] Noah Labhart: Well, let's flip the script a little bit, Dan. Dan, tell me about a mistake you made and how you and your team responded to it. [0:16:01] Dan Draper: There are so many mistakes I've made in my career and certainly many at CipherStash. I see every mistake as an opportunity to learn something. The biggest mistake is the one you make twice. But I certainly think one of the major mistakes we made in the early days of the CipherStash journey was trying to get developers to come to us, trying to get people to come and work in the way that we wanted them to work. a big ask, frankly, not only to get developers to change the way that they work, but to do so with a product that they've never even heard of, or a technology that they're unfamiliar with. So I think the lesson for us was try and find the ways that developers are using encryption technology now, or find ways that they're trying to protect or keep sensitive data safe, and how do we plug into that? It was a difficult lesson, frankly, but one of the most important ones that we've had. [0:16:57] Noah Labhart: What does the future look like for the product and for your team? [0:17:02] Dan Draper: We see opportunities for CipherStash in a range of different settings. At the moment, it's mostly smaller organizations that are using it. We think there's big opportunities for it in the enterprise as well. So a big part of our focus now is doing very large-scale tests, demonstrations, to show that CipherStash can scale to hundreds of millions or even billions of records. interesting kind of search capabilities on a roadmap as well. So things like geospatial indexes, we can do geospatial queries across, you know, encrypted longitude and latitude values, which is really interesting to me. Things like simple ranked search, the ability to do basic aggregate queries. So we can do counts at the moment, or we want to be able to do summations and averages. There's some interesting technology there, technology called Paillier encryption, which is a encryption, which I'm sure we could do a whole conversation about. But that provides the ability to do summations and averages over data in a really efficient way. And really beyond that, it's about making CipherStash as accessible to as many developers as possible. So as I mentioned, right now we support Ruby on Rails and Node.js. We're building out our integrations for Golang, for C Sharp, for Java, and Python. The goal is to make it available to as many people as we possibly can. [0:18:30] Noah Labhart: So let's switch to you, Dan. Who influences the way that you work? Name a person you look up to and why. [0:18:37] Dan Draper: I've been very fortunate to have lots of great mentors in my life. I think there's a few people that I'll mention, or maybe I'll mention one or two. One in particular was a mentor of mine. We used to spend a lot of time together, but he was incredibly influential in my life. A guy named Hugh Williams, who was a former professor of computer science at RMIT here in Australia. But he also spent lots of time in senior leadership roles at Google, Microsoft and eBay. And he's kind of the search guy. So his PhD was on information retrieval systems. So what I really enjoyed about my time with Hugh was learning the connection between technology and people. to find people in our industry that understand how to lead teams, but also how to build great technology. And Hugh was certainly one of those people and had a massive impact on how I think about the world. And the other person I should mention is a guy called Kevin Rowney, who's a mentor of mine who I just had dinner with in San Francisco a couple of weeks ago. He's a math nerd, which I really, really resonate with, but he's also worked in enterprise sales. and that's an interesting combination. What I appreciated about Kevin was he helped me as an engineer, as a tech guy, understand how to sell. It's been a really fruitful relationship. He helps me cut through the bull crap when it comes to enterprise sales and it's been a really rewarding relationship as well. I feel like I should mention one more. The two mentors I mentioned so far are both men, but there's also a woman who has been a wonderful source of inspiration for me. Her name is Emma Jones, and she specializes in helping developer teams and tech companies more broadly build more diversity in their workforce. And she's helped me understand that a diverse team is a productive team and a successful team, and she's been a huge influence in my career and life as well. [0:20:44] Noah Labhart: Dan, we talked about a mistake earlier, right? But a little bit different spin. If you could go back to the beginning, what would you do different? Or where would you consider taking maybe a different approach? [0:20:54] Dan Draper: I wish that I had learned about cryptography earlier. I remember I studied electrical engineering at university back in Adelaide in the early 2000s. And I've always been fascinated by technology. I've always been fascinated by programming and developing software. at university, probably in about 2002, there was an elective called cryptography. And I thought, why would anyone do that? That sounds really boring. Oh, had I realized then what I know now, that cryptography is the thing that has shaped my career of the last five years. I wish that I knew more about it earlier on in my career. Frankly, I wish more developers understood cryptography. It's one of the most important things in our modern world. I know that sounds slightly overblown, form safe e-commerce. You can't have safe messaging on the internet without cryptography. Our whole world runs on data. If we can't protect it, society collapses. So I really do believe cryptography is one of the most important things in our industry. And I really wish that I had explored it and understood it better earlier on in my career. [0:22:07] Noah Labhart: Well, last question, Dan. So you're getting on a plane and you're sitting next to a young entrepreneur who's built the next big thing they're jazzed about it they can't wait to show it off to the world and can't wait to show it off to you right there on the plane what advice do you give that person having gone down this road a bit [0:22:22] Dan Draper: it's difficult to give this advice to somebody who's has just come up with an idea and they're really excited about selling it to the world but the advice i give to anyone that has an entrepreneurial instinct is to go and work for another startup first. I did my first startup when I was something like 21 years old. I had no experience. I had no idea what I was getting myself into. And it took me a number of years to work stuff out. Probably things that I would have learned a lot more quickly had I learned from another founder or just spent time in another startup. Since then, I've worked for several other startups and I think I'm a much, much better entrepreneur and a much better leader because of it. If you have an opportunity to work in a startup for two or three years before trying your own, I think it's going to set you up for success. You'll not only understand some of the challenges associated with building a business, you'll understand what the investment ecosystem is like, how to find investors, how to talk to investors. You'll understand more about the talking to customers. It's not just about technology. In fact, one of the hardest lessons I've learned over the years as a tech guy is the technology really, even in a company like CipherStash, which is highly technical, is really only a small fraction of the overall pie. You have to understand all of the aspects of how a business runs to be a successful entrepreneur. And one of the greatest ways to do that is to work for another startup. [0:24:01] Noah Labhart: I completely agree with that. Well, Dan, thank you for being on the show today. Thank you for telling the creation story of CipherStash. [0:24:08] Dan Draper: Thanks so much for having me, Noah. It's been great. [0:24:12] Noah Labhart: And this concludes another chapter of Code Story. Code Story is hosted and produced by Noah Labhart. Be sure to subscribe on Apple Podcasts, Spotify, or the podcasting app of your choice. Support the show on patreon.com slash Code Story for just five to ten bucks a month. And when you get a chance, leave us a review. Both things help us out tremendously. And thanks again for listening.