title: Generating Alphanumeric OTP using HOTP
body: <p>I understand that HOTP can be used to create numerical One Time Passwords. The algorithm behind being:</p>
  
  <blockquote>
    <p>K be a secret key <br>
    C be a counter<br>
    HMAC(K,C) = SHA1(K ⊕ 0x5c5c… ∥ SHA1(K ⊕ 0x3636… ∥ C)) with ⊕ as XOR, ∥ as concatenation, (C is the message)<br></p>
  </blockquote>
  
  <p>Truncate be a function that selects 4 bytes from the result of the HMAC in a defined manner.</p>
  
  <p>Then HOTP(K,C) is mathematically defined by:</p>
  
  <blockquote>
    <p>HOTP(K,C) = Truncate(HMAC(K,C)) &amp; 0x7FFFFFFF</p>
  </blockquote>
  
  <p>I have used the following example implementation for my tests and it works fine:</p>
  
  <p><a href="https://svn.forgerock.org/openam/tags/10.0.0-docs/products/amserver/source/com/sun/identity/authentication/modules/hotp/HOTPAlgorithm.java" rel="nofollow noreferrer">https://svn.forgerock.org/openam/tags/10.0.0-docs/products/amserver/source/com/sun/identity/authentication/modules/hotp/HOTPAlgorithm.java</a></p>
  
  <p>My question is that is it possible to generate an alphanumeric OTP using HOTP instead of numeric. The advantage obviously being that the strength of OTP increases manyfold for a given length. So a 8 digit alphanumeric code is far stringer than an eight-digit numeric code.</p>