An Android app that sends encrypted SMS through an SMPP gateway, then checks that the server received exactly what was sent.
Built with samanmohammadraouf, who wrote the server: SMPP_Server. The original repo is samanmohammadraouf/AndroidSecureMessageProtocol.
| Send a message | Ack received |
|---|---|
![]() |
![]() |
| Phone SMS app | Our inbox | Settings |
|---|---|---|
![]() |
![]() |
![]() |
Server side:
- Send. You type a number and a message. The app encrypts the text with AES, wraps it in
$$markers and sends it as an SMPPSUBMIT_SMthrough the gateway, using Cloudhopper SMPP. - Ack. The server decrypts the message and replies by SMS with the SHA-256 hash of the text. Replies that end with
| AFTSTCare acks. - Check. The app catches incoming SMS with a
BroadcastReceiver, decrypts them and compares the hash in the ack with the hash of what it sent. If the hash and the number both match, the message is marked as delivered. If not, the app asks you to send it again, because the message may have been changed on the way. - Inbox. Sent and received messages are read from Android's SMS store, decrypted and shown as a chat.
Gateway host, port, username, password and the key are set once in Settings and kept in SharedPreferences.
At first we also received messages over SMPP, but the Ozeki gateway kept dropping the connection while it ran in the background. Receiving through a BroadcastReceiver fixed that.
- Install Ozeki SMPP SMS Gateway Lite on a phone and connect it.
- Install SmppClient (this app) and enter the gateway details in Settings.
- For the key, use your own or the demo key
a7b2c3d4e5f6g789abcdef0123456789. The server has to use the same key. - Run SMPP_Server.
| File | What it does |
|---|---|
| Smpp.kt | SMPP session and sending |
| SMSReceiver.kt | Catches incoming SMS, decrypts them, spots acks |
| SecurityUtil.kt | AES encryption and SHA-256 hashing |
| MainActivity.kt | Send screen and the ack check |
| SMSActivity.kt | Inbox |
| SettingsActivity.kt | Gateway and key settings |
Kotlin, Android 6.0 and up (min SDK 23).
This was a learning project, so the encryption is simple: AES in CBC mode with an all zero IV, and the key is used directly as bytes. A real version would use a random IV for every message and an authenticated mode such as AES GCM.





