├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── sample_button.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── sample_fragment.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── themes.xml │ │ │ │ └── strings.xml │ │ │ ├── xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── securevale │ │ │ │ └── androidcryptosamples │ │ │ │ ├── ui │ │ │ │ ├── dto │ │ │ │ │ └── OperationResult.kt │ │ │ │ ├── lifecycle │ │ │ │ │ └── ClearOnDestroyObserver.kt │ │ │ │ ├── MessageDigestSampleFragment.kt │ │ │ │ ├── RsaSampleFragment.kt │ │ │ │ ├── AesGcmSampleFragment.kt │ │ │ │ ├── AesCbcSampleFragment.kt │ │ │ │ ├── HmacSampleFragment.kt │ │ │ │ ├── SignatureSampleFragment.kt │ │ │ │ ├── adapter │ │ │ │ │ └── SamplesAdapter.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── BiometricSampleFragment.kt │ │ │ │ └── KeyDerivationSampleFragment.kt │ │ │ │ ├── encryption │ │ │ │ ├── symmetric │ │ │ │ │ └── aes │ │ │ │ │ │ ├── ecb │ │ │ │ │ │ └── AesEcb.kt │ │ │ │ │ │ ├── cbc │ │ │ │ │ │ └── AesCbc.kt │ │ │ │ │ │ └── gcm │ │ │ │ │ │ └── AesGcm.kt │ │ │ │ └── assymetric │ │ │ │ │ └── rsa │ │ │ │ │ └── Rsa.kt │ │ │ │ ├── hash │ │ │ │ └── MessageDigest.kt │ │ │ │ ├── helpers │ │ │ │ └── Security.kt │ │ │ │ ├── derivation │ │ │ │ └── KeyDerivation.kt │ │ │ │ ├── mac │ │ │ │ └── Hmac.kt │ │ │ │ ├── signature │ │ │ │ └── Signature.kt │ │ │ │ └── advanced │ │ │ │ └── biometric │ │ │ │ └── Biometric.kt │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── securevale │ │ └── androidcryptosamples │ │ ├── testhelpers │ │ └── TestHelpers.kt │ │ ├── mac │ │ └── HmacTest.kt │ │ ├── assymectric │ │ └── rsa │ │ │ └── RsaTest.kt │ │ ├── symmetric │ │ └── aes │ │ │ ├── cbc │ │ │ └── AesCbcTest.kt │ │ │ └── gcm │ │ │ └── AesGcmTest.kt │ │ ├── hash │ │ └── MessageDigestTest.kt │ │ ├── signature │ │ └── SignatureTest.kt │ │ └── derivation │ │ └── KeyDerivationTest.kt └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── LICENSE ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .cxx 10 | local.properties -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securevale/android-cryptography-samples/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jun 28 15:09:26 CEST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/securevale/androidcryptosamples/ui/dto/OperationResult.kt: -------------------------------------------------------------------------------- 1 | package com.securevale.androidcryptosamples.ui.dto 2 | 3 | @Suppress("ArrayInDataClass") 4 | data class OperationResult( 5 | val data: String = "", 6 | val iv: ByteArray = byteArrayOf() 7 | ) { 8 | 9 | fun hasNoData() = data.isBlank() 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/sample_button.xml: -------------------------------------------------------------------------------- 1 | 2 |