Code contains 2 examples:
- example of storage encryption
- example of transfer encryption
Please, see AppDelegate
for entry point (comment/uncomment example you want to run).
Secure Cell is container for symmetric encryption. Secure Cell provides:
- integrity protection (calculates ~hmac to ensure that message was not changed)
- context-dependent (both key and context are important)
- tampering protection
-
Run CellDemo
CellDemo().runDemo()
-
Encrypt-decrypt several messages
-
Can you decrypt messages using other context?
- Keys are plaintext.
Using any good storage encryption library makes your work useless if you store keys in plain text.
Secure Session helps to establish session between two peers, within which data can be securely exchanged with higher security guarantees.
Create iOS app and server system to exchange the messages
- secure end-to-end communication
- perfect forward secrecy
- strong mutual peer authentication
- Open server dashboard, copy serverId, url and public key.
- In source code: update serverId, server url and server public key.
- Run sample and send a message to the server
- See it on the dashboard
- Keys are plaintext.
- ATS is disabled at all
Using any good transfer encryption library makes your work useless if you store keys in plain text and disable ATS.
- Swift docs for Themis library.
- SwiftAlps event
- Links to workshop slides
Thanks @valeriyvan for several important PRs!