RFC 6238 in Common Lisp 0 ▲ Abstract Heresies 2 hours ago · Tech · hide · 0 comments I wanted to implement 2FA as per RFC 6238. This is the Time-based One-Time Password (TOTP) algorithm that is used by Google Authenticator and other 2FA apps. This was originally `vibe coded`. The vibe coding got me 80% of the way there, and I made a manual pass to turn it into a more functional style. Feel free to use this under an MIT license. ;;; -*- mode: lisp; coding: utf-8-unix; -*- ;;; RFC 6238: TOTP (Time-Based One-Time Password Algorithm) implementation in Common Lisp ;;; This implementation provides functions to generate a ;;; base32-encoded secret, create a QR code URI for authenticator ;;; apps, and verify TOTP codes based on the current time. It ;;; adheres to the specifications outlined in RFC 6238 and RFC 4226. ;;; Dependencies: cl-base32, ironclad (in-package "TOTP") (defun generate-secret (&optional (length 10)) (cl-base32:bytes-to-base32 (ironclad:random-data length))) (defun generate-qr-uri (secret email &key (issuer "JRM-Code")) (format nil… No comments yet. Log in to reply on the Fediverse. Comments will appear here.