This blog post explores the challenges of creating a robust test suite for Time-Based One-Time Password (TOTP) algorithms. The author highlights the difficulty in balancing the need for deterministic, repeatable tests with the time-sensitive nature of TOTP codes. They propose using a fixed timestamp and shared secret as a starting point, then exploring variations in time steps and time drift to ensure the algorithm handles edge cases correctly. The post concludes with a call for collaboration and shared test vectors to improve the overall security and reliability of TOTP implementations.
People with the last name "Null" face a constant barrage of computer-related problems because their name is a reserved term in programming, often signifying the absence of a value. This leads to errors on websites, databases, and various forms, frequently rejecting their name or causing transactions to fail. From travel bookings to insurance applications and even setting up utilities, their perfectly valid surname is misinterpreted by systems as missing information or an error, forcing them to resort to workarounds like using a middle name or initial to navigate the digital world. This highlights the challenge of reconciling real-world data with the rigid structure of computer systems and the often-overlooked consequences for those whose names conflict with programming conventions.
HN users discuss the wide range of issues caused by the last name "Null," a reserved keyword in many computer systems. Many shared similar experiences with problematic names, highlighting the challenges faced by those with names containing spaces, apostrophes, hyphens, or characters outside the standard ASCII set. Some commenters suggested technical solutions like escaping or encoding these names, while others pointed out the persistent nature of the problem due to legacy systems and poor coding practices. The lack of proper input validation was frequently cited as the root cause, with one user mentioning that SQL injection vulnerabilities often stem from similar issues. There's also discussion about the historical context of these limitations and the responsibility of developers to handle edge cases like these. A few users mentioned the ironic humor in a computer scientist having this particular surname, especially given its significance in programming.
Summary of Comments ( 0 )
https://news.ycombinator.com/item?id=43230922
The Hacker News comments discuss the practicality and usefulness of the proposed TOTP test suite. Several commenters point out that existing libraries like oathtool already provide robust implementations and question the need for a new test suite, suggesting that focusing on testing against these established libraries would be more effective. Others highlight the potential value in testing edge cases and different implementations, particularly for less common languages or when implementing TOTP from scratch. The difficulty in obtaining a diverse and representative set of real-world TOTP secrets for testing is also mentioned. Finally, some commenters express concern about the security implications of publishing a comprehensive test suite, fearing it could be misused for malicious purposes.
The Hacker News post "Towards a test-suite for TOTP codes" has generated a moderate discussion with several insightful comments.
One commenter highlights the inherent difficulty in creating a comprehensive test suite for TOTP due to the time-based nature of the algorithm. They explain that because TOTP codes are generated based on the current time, a pre-generated list of valid codes would quickly become outdated. They suggest that a more practical approach would be a test suite that verifies the process of generating TOTP codes, rather than testing against specific code values. This could involve testing the underlying HMAC-SHA1 algorithm and ensuring the correct time window and secret key are used.
Another commenter points out a potential vulnerability related to clock drift. They explain how a small difference between the server's clock and the client's clock can lead to valid TOTP codes being rejected. They suggest testing for resilience against such clock drift by allowing a tolerance of one or two time steps in either direction. This reinforces the idea that a robust test suite should focus on the algorithm's behavior under various conditions, including imperfect time synchronization.
A further comment discusses the practical challenges of testing TOTP in real-world scenarios. They mention the difficulty of simulating time changes and the need to mock or control the system clock during testing. This highlights the complexity of thoroughly testing time-dependent systems.
Finally, one commenter mentions the existence of RFC 6238, which specifies the TOTP algorithm. They suggest that any test suite should adhere to the guidelines and test vectors provided in the RFC. This ensures compliance with the standard and provides a baseline for interoperability.
The overall sentiment in the comments is that while creating a comprehensive, pre-generated test suite for TOTP codes is impractical, a valuable test suite can focus on validating the algorithm's implementation and its resilience to factors like clock drift and edge cases. The comments underscore the importance of testing the process of generating TOTP codes, rather than the codes themselves, and adhering to the RFC specifications.