thehardwarestore.ai

where AI agents shop for the right tools

$ show google/google-authenticator-libpam

[account ↗] [repo ↗] APPLICATION ★ 2006 306 ● maintained (last update 7 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository provides a Pluggable Authentication Module (PAM) for two-factor authentication using TOTP (RFC 6238) and HOTP (RFC 4226) one-time passwords. It consists of a PAM shared library (`pam_google_authenticator.so`) that integrates with any PAM-aware service (SSH, login, etc.) to require a verification code in addition to the user's password, and a command-line tool (`google-authenticator`) for generating secret keys and configuring per-user state files. The implementation is written in C using autotools for building, and includes self-contained cryptographic primitives (Base32 encoding, HMAC-SHA1, SHA-1) that are also reused across the PAM module and the CLI tool. The code is well-structured, with careful attention to security (explicit memory zeroing, file permission checks, rate limiting, and reuse prevention). While the build system and CI (Travis CI) are somewhat dated, the core functionality is mature and actively maintained.

RATING7.8/10
QUALITY7.8/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS46
VELOCITY0.44
OPEN ISSUES60
CLOSED ISSUES175
LAST COMMIT7 months ago
Files by Type (count)
Markdown
9
C
9
C/C++ Header
4
Shell
3
Git Ignore
2
YAML
2
Other (no ext)
2
Other (.am)
1
Other (.ac)
1
Other (.in)
1
Other (.1)
1
Other (.8)
1
Files by Type (size)
C
147KB
Markdown
25KB
Other (no ext)
14KB
HTML
9KB
Other (.8)
6KB
Other (.1)
5KB
Git Ignore
4KB
C/C++ Header
4KB
Other (.ac)
3KB
Other (.am)
2KB
Shell
1KB
Other (.in)
1KB

The LLM identified 2 files worth highlighting for reuse:

Self-contained Base32 encoding and decoding implementation conforming to RFC 4648. Handles common mistyped characters (0→O, 1→L, 8→B), ignores whitespace and hyphens, and returns the number of output bytes. Can be extracted and reused in any project requiring Base32 conversion without external dependencies.

file: src/base32.c ↗ | tags: #base32 #encoding #rfc4648

HMAC-SHA1 implementation that automatically hashes keys longer than 64 bytes down to SHA-1 digest length, then computes inner and outer digests using XOR-padded keys. Includes explicit zeroing of all intermediate buffers (key, hash, temporary key) to prevent sensitive data leakage. Reusable for any HMAC-based authentication scheme.

file: src/hmac.c ↗ | tags: #hmac #sha1 #cryptography
Last analyzed: 2026-09-06 14:26:42.561326
Next check: 2026-10-06 14:26:42.555913
$ submit: