# Introduction

(Script tags will be stripped)


The use of cryptographic algorithms is spreading very quickly.

Thanks to CryptoSwift (https://cryptoswift.io/) the Swift community now has a very powerful library offering a wide variety of algorithms thanks to **Marcin Krzyzanowski**. Find CryptoSwift here https://github.com/krzyzanowskim/CryptoSwift

You can now run these algorithms on Android and iOS using the same codebase by simply referencing the CryptoSwift SPM package in SCADE.

Example Source Code

Please find the Source code here: https://github.com/scadedoc/UgExamples/tree/master/UgCryptoSwift See [Installing examples](🔗) for information on how to download the examples.

Video

https://www.youtube.com/watch?v=GGkqO-0yQ9Y

# Reference the CryptoSwift SPM package

  1. Create new SCADE project

  2. Open build file and set **URL** to **https://github.com/krzyzanowskim/CryptoSwift**

  3. Set **from** field to **0.11.0**

  4. Set **linkedLibs** to "CryptoSwift"

_Done_. You can now use CryptoSwift to build native mobile apps on Android and iOS in Swift

(Script tags will be stripped)


# Use CryptoSwift

For example, In the load method, compute MD5 value like this:



which results in

(Script tags will be stripped)


# Adding UI

To complete this little demo, lets add a more compelling UI that allows to enter values and compute Md5 values on the fly. The layout of the app is as such:

(Script tags will be stripped)


If you are not familiar with visual designing a UI, please see our video. The resulting UI looks like this:

(Script tags will be stripped)


# Adding UI Code

Now lets add the code to capture each text entry and set the lbMd5 label with the MD5 value of the text that was entered:



# Compile and run on Android and iOS

(Script tags will be stripped)