Security at DiOTP: How we protect your OTPs, keys and data

This page lists the security controls built into the DiOTP OTP gateway, in plain English. Everything in the first part of the table is how the system works today. Anything we have not yet confirmed is marked as such, so you can tell the difference.

Traffic
All traffic is over HTTPS.
OTP codes
Generated by DiOTP and never sent to your server. Stored only as a SHA-256 hash, compared in constant time, expire after 5 minutes, 5 attempts, single use.
API keys
192-bit random, stored only as a hash, shown once, revocable.
Dashboard passwords
Hashed with bcrypt. 10 failed logins in 15 minutes locks further attempts for that email for a period.
Sessions
Refresh tokens expire after 14 days and are stored hashed.
Third-party credentials
SMTP settings and sending credentials are encrypted at rest with Fernet (AES-128 in CBC mode with HMAC-SHA256).
Webhooks
Signed with HMAC-SHA256 using a per-endpoint secret shown once, with a timestamp to stop replays.
Retention
Destination numbers in OTP records are masked to the last 4 digits after 90 days.
Access control
Roles separate platform administrators from customer users. Customer users reach only their own account.
Abuse limits
Per number, per API key and per account.

How OTP codes are protected

The code is the most sensitive thing an OTP service handles, so DiOTP keeps it away from everyone who does not need it. When your server calls the send endpoint, DiOTP generates the code, sends it to the phone and returns only a request_id. Your server never receives the code, so it cannot end up in your logs, your database or an error report.

On our side the code is stored only as a SHA-256 hash, never as the digits themselves. When your user types a code and your server passes it to the verify endpoint, we hash what was typed and compare the two hashes in constant time, so the time a check takes does not hint at how close a guess was.

  • A code expires 5 minutes after it is sent.
  • Each code allows 5 attempts. After that the request ends and a new code is needed.
  • A code can be verified only once. A second check of the same request is refused.

Our guide to OTP security best practices covers what to do on your side of the flow, such as what to show users and how to handle errors.

API keys

Each API key is 192 bits of randomness, far beyond what anyone could guess. We store only a hash of the key, so even someone with a copy of our database could not read it back. That is also why the full key is shown once, when you create it: copy it into an environment variable on your server at that moment.

Keys can be revoked from the dashboard at any time. If a key is exposed, for example committed to a repository or pasted into a support chat, revoke it and create a new one. Keep keys on your server only; a key in a mobile app or browser code can be extracted by anyone who downloads it. The API documentation shows how to pass the key in the Authorization header.

Dashboard sign-in and sessions

Dashboard passwords are hashed with bcrypt, a slow hashing method designed to make stolen password hashes expensive to crack. We never store a password as plain text.

Sign-in attempts are rate-limited. After 10 failed attempts in 15 minutes, further attempts for that email address are locked for a period, which blunts password-guessing attacks against a single account.

Once you are signed in, the session is kept alive with a refresh token. Refresh tokens expire after 14 days and, like passwords and API keys, are stored only as hashes.

Credentials you give us

Some settings hold secrets that belong to you or to a service we connect to, such as SMTP settings and sending credentials. These are encrypted at rest with Fernet, which combines AES-128 in CBC mode with an HMAC-SHA256 check, so the stored value can be neither read nor quietly altered without the key.

Signed webhooks

When DiOTP sends an event to your webhook endpoint, the request carries an HMAC-SHA256 signature made with a secret unique to that endpoint. The secret is shown once, when you add the endpoint. Your server recomputes the signature and rejects anything that does not match, so a forged request is refused.

The signature covers a timestamp as well as the body. Checking that the timestamp is recent stops an attacker from capturing a genuine request and replaying it later.

Who can see what

Access is controlled by roles. Platform administrators, who run DiOTP, have a separate role from customer users. A customer user can only reach their own account. The account is taken from the login itself, never from an ID in the URL, so changing a link cannot open someone else's data.

Abuse limits

Every send passes limits per destination number, per API key and per account. By default a number can be sent a new code once every 30 seconds, up to 3 codes an hour and 10 a day, and a key can make up to 30 sends a minute. A send stopped by a limit is not sent and not charged. These limits are the first defence against SMS pumping fraud, explained in our guide to SMS pumping protection.

Data retention

We keep OTP records as an audit trail, because they help you and us investigate delivery questions and disputes. We do not need the full phone number for that forever. After 90 days, the destination number in each OTP record is masked to its last 4 digits, and the rest of the record stays.

We built this with the thinking behind India's Digital Personal Data Protection Act, 2023 in mind: keep personal data only as long as it serves a purpose. This is a description of how our system behaves, not a claim of legal certification. How we handle personal data is set out in our privacy policy, and the terms for data you send through us are in the data processing agreement.

Certifications and security reviews

This page does not claim ISO 27001, SOC 2 or any other third-party certification. If your procurement process needs a security questionnaire answered, email us and we will answer what we can confirm. Our support hours and reply times apply to security questions too.

Your part, and reporting an issue

Security is shared. Keep API keys on your server, verify webhook signatures, and send only the messages our acceptable use policy allows. If you believe you have found a security problem in DiOTP, email otp-support@diorbit.com with the details and steps to reproduce it, and please give us time to fix it before sharing it publicly.

Security: questions

No. DiOTP generates the code, sends it and checks it. Your server receives only a request_id when it sends, and passes the code your user typed to the verify endpoint. The code itself is never returned to you, so it cannot leak from your systems.

Start building your customer messaging with DiOTP

Free test credits on sign-up, API keys in a minute, and a team that picks up the phone.