I Want to write a javacard applet for SIM-Card (USIM) to encrypt and decrypt SMS for specific number. i don't want to install any application on mobile phone and SIM-card applet has to detect the message is belong to specific number and encrypt or decrypt it. Can i write such javacard applet by SIM toolkit package or anything else to do this process technically?
2 Answers
Yes, such application can be written by the help of sim toolkit API's.
Use the following toolkit event for processing your application: -
- ENVELOPE(SMS-PP ... formatted) from 3GPP TS 31.130 V6.6.0 (2007-06)
- From envelope handler, extract the origin address (refer TAG)(phone number of sender).
- Do the operation.

- 656
- 4
- 10
-
Thank you for your guidance. – Mohsen Gorgani Nov 21 '17 at 14:19
-
Dear hsg: For testing my sim toolkit applet, Is there a free simulator which works like a SIM card? – Mohsen Gorgani Nov 23 '17 at 12:00
-
To my knowledge, there is no open source simulator available for sim toolkit applet. You need to develop you own over and above to other jcde simulators. – hsg Nov 26 '17 at 15:33
-
Dear hsg, I have another question and i will appreciate if you can help me. suppose SIM card decrypts received message, how i show decrypted message in handset inbox? – Mohsen Gorgani Dec 12 '17 at 05:40
-
1If I assume the handset inbox to be a standard SMS inbox of mobile phone, then I doubt it would not be possible. But, you can use proactive commands from SIM Toolkit framework to achieve a similar result like this. Refer ETSI 11.14 specifications for this. – hsg Dec 14 '17 at 05:01
-
thank you for your response, so i can't store decrypted sms in inbox. – Mohsen Gorgani Dec 14 '17 at 09:03
-
if i understand your point correctly, I can show decrypted message on handset screen. does it? can i show message on any handset like Nokia 1100? ;) – Mohsen Gorgani Dec 14 '17 at 09:07
-
1SMS are stored in SIM file system as well as in mobile phone internal storage. You can only support the functionality (show messages) where the interaction with SIM is possible, I suggest you to check file system under Telecom directory (DF 7F10 I guess). But I am certain that some kind of SIM file system write or SIM toolkit proactive commands should be required. – hsg Dec 17 '17 at 08:57
-
Thanks hsg, what do you mean about "where the interaction with SIM is possible". Do you mean, I have to develop an app on mobile OS? – Mohsen Gorgani Dec 17 '17 at 09:52
-
"where the interaction with SIM is possible" Yes, to show the messages stored in SIM memory in mobile phone, an app would be required which will contact a running java card applet on SIM and extract the messages. – hsg Dec 21 '17 at 06:49
to encrypt and decrypt SMS for specific number.
You would have SIM applet installed on the originator and recipient's SIM and the STK Toolkit menu application needed. Basic DSTK menu application shall be developed to send encrypted SMS. You may need to protect to access this application with PIN code. Let the user the fill text area with any alphanumeric input and next page collect the recipient number. Encrypt text and send it your ESME application as User Data using SEND SHORT MESSAGE
proactive command.
In order to send your secure data to ESME application using SMS-PP, it is required to have short code and SMPP connection from ESME application to SMSC. ESME application decomposes the secure data, re-generates it for recipient's SIM applet by setting data coding scheme (0xf6), signs with OTA keys for the recipient number and sends the secure data directly to recipient's SIM.
SIM applet on recipient's SIM processes the secure data, decrypt and shows it as OTA push on recipient's display.

- 307
- 3
- 12