Let’s discuss a few rules of thumb for logging in Go, as well as some features you may not have heard of that can make debugging easier. Best practices for logging in Go are not so obvious and sometimes we need to look closer to see what is the best choice, considering the unique situation of error handling in Go. Use Errors Where Appropriate, Not Strings Wrap Errors Use Formatters Like fmt.
Quantum Computing Quantum computing may not be coming quite as fast as some in the field had certainly feared (or perhaps hoped). Google did, however, solve an impressive problem this year. They published a paper in Nature. It stated that their quantum processor solved a problem that, in contrast, a digital computer would take 10,000 years to solve. The problem that was solved deals with generating certifiably random numbers. Their processor, ‘Sycamore’, uses 53 qubits, which corresponds to a search space of 1016.
AES, or “Advanced Encryption Standard”, is an encryption specification that uses the Rijndael cipher as its symmetric key ciphering algorithm. AES encrypts a message with a private key, and no one but the key holder can decrypt the message. A great example of a good use-case for AES-256 is encrypting all the data on the hard drive of a computer when it’s not in use. Symmetric Encryption vs Asymmetric Encryption Symmetric encryption uses the same key for encryption and decryption and asymmetric encryption uses different keys.
Hash functions are used to securely store passwords, find duplicate records, quickly store and retrieve data, among other useful computational tasks. As a practical example, all user passwords on boot.dev are hashed using Bcrypt to ensure that if an attacker were ever to gain access to our database our user’s passwords wouldn’t be compromised. I want to focus on several important features of cryptographic hash functions, arguably the most important features:
A Key Derivation Function, or KDF, is a cryptographic algorithm that derives one or more secret keys from a secret value. If you’ve ever needed to store a password in a database or create a private key from a password, you may have used a KDF. Some examples of popular KDFs are Argon2, Scrypt, and PBKDF2. Are KDFs Just Hash Functions? No, but there is overlap. In order to understand KDFs, let’s first go through a quick refresher on hash functions.
Many new developers are jumping right into writing code, usually for those fat paychecks, without learning much about the history of Computer Science. Alan Turing is recognized as the father of Computer Science, though many don’t know that his roots were in cryptology and mathematics. It was out of cryptology, cryptography, and mathematics that computer science was born. What many computer scientists even these days don’t recognize is that cryptography and cryptography are not the same.
The podcast is available here. Before I begin, I must give thanks to Nick for having me on the show! In this episode of Running in Production, I talk with Nick about how we built boot.dev, an open-source password manager that specializes in cryptocurrency. Boot.dev uses Electron and has a Serverless component that uses Golang. It’s all hosted on AWS. If you were ever wondering how Serverless works in the context of building a native or web application, then this episode is going to be a good listen.
Once upon a time, a company I worked for had a problem, we had thousands of messages flowing through our data pipeline every second, and we wanted to be able to send real-time emails, SMS, and Slack alerts when messages matching specific criteria were found. A simple solution built using ElasticSearch’s percolate queries ended up being our saving grace. Our first failed attempt to build an alerting system utilized PipelineDB. To make a long story short, not only was that architecture rigid and hard to make changes to, it didn’t scale well and was constantly having performance issues.