# Bug OP-16898 - Mobile OTP generation does not cover all decimal digits

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-16898

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.5.0 |
| Observed in versions | 8.2.0 |
| Sprint | 15.5.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 8.2.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Jan Sandbrink |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Enable two-factor authentication using a mobile OTP (i.e. receiving a code to your mobile phone

2.  Receive a bunch of codes and remember them

### What is the buggy behavior?

  - None of the codes will ever contain the number "9" (humanly testable)

  - The codes are generated using a random number generator that's not using a sufficiently secure source of randomness (not really humanly testable)

### What is the expected behavior?

  - All the well known decimal digits (zero to nine) should appear in OTP codes

  - they should be sufficiently randomized

### Environment information

**OpenProject installation type**

any

**OpenProject version**

any with 2FA
