September 2025 Go Meetup
Meetup #78 on September 17 in person at Edmonton Unlimited at 6:00 pm.
Please RSVP at Meetup
News
Agenda
Benchmarking Redo
Peter Preeper gave a redo of his benchmarking talk, this time using a Go port of a Python Sudoku solver as the subject. He showed how benchmarks live in main_test.go next to ordinary tests, with func BenchmarkSudokuSolver(b *testing.B) and a parallel variant using b.RunParallel, iterating with b.N in the slides and the newer b.Loop() in the code. The solver itself works by backtracking: find the next empty cell, try valid guesses, recurse, and undo on failure, checking rows, columns, and 3×3 squares. Results were compared against a Python timing script that measured operations per second and ns/op. The point was to see how fast the same algorithm runs in Go versus Python and how to set up meaningful benchmarks.
Key points:
- Benchmarks live in
_test.gofiles alongside tests. func BenchmarkX(b *testing.B)runs the body repeatedly for timing.- Loops use
b.N(or newerb.Loop()) to measure work. b.RunParallelexercises parallel performance.- The Sudoku solver uses backtracking with row/column/square validation.
- Validate results inside benchmarks so you're timing correct work.
- Compared Go's numbers with a Python timing harness (
ns/op).
How RSA keys work
Andrew gave a talk on how RSA keys actually work, starting from the PEM files that begin with MII and are used every day for TLS and SSH. He built up from a Caesar cipher and an xor one-time pad to explain why symmetric encryption needs a shared secret, then introduced asymmetric encryption through a public/private padlock analogy. From there he worked through the real RSA math using Go's crypto/rsa: generating a small key to inspect, ASN.1/DER and PEM encodings, encryption as m^e mod n, and decryption with the private exponent d. He derived d using the extended Euclidean algorithm and modular inverses, then used Euler's totient theorem to prove why decryption recovers the message, and showed that signing is just decryption with the private key. The talk closed with precomputed CRT parameters for faster decryption, timing comparisons, and the security caveat that RSA rests on the difficulty of factoring n = p×q while implementation bugs and parameter choices can still break it.
Key points:
- PEM keys starting with
MIIare ASN.1/DER-encoded data in base64. - Encryption is
m^e mod n; decryption isc^d mod n. dis the modular inverse ofemod(p−1)(q−1), found via extended Euclid.- Euler's totient theorem explains why RSA decryption works.
- Signing is decryption with the private key; verification is encryption with the public key.
- Precomputed CRT parameters (dp, dq, qInv) speed up decryption.
- Security relies on the hardness of factoring n = p×q, but implementation bugs matter.
Future Topics Discussion
Open discussion on topic for future talks, workshops, activities.
Events
- Edmonton Go Meetup October