Git Product home page Git Product logo

encrypt-file's Introduction

EncryptFileClass

EncryptFileClass is an Android Kotlin class that simplifies the process of encrypting and decrypting files with advanced features and customization options. It leverages the Android Keystore system and biometric authentication to enhance security. This class is designed to be versatile and easy to integrate into your Android applications for securing sensitive files.

Features

  • File encryption and decryption with optional biometric authentication.
  • Utilizes the Android Keystore system for secure key management.
  • Supports advanced customization options to tailor the behavior to your specific requirements.
  • Integration with biometric authentication to protect files with fingerprint or face recognition (on supported devices).
  • Handles the creation of an encrypted version of the file, without overwriting the original.

Usage

  • Initialization: Create an instance of EncryptFileClass by providing a Context and the File you want to encrypt or decrypt.
  • Customization: You can customize various aspects of the encryption process, such as enabling or disabling the use of biometric authentication, specifying the path to save the encrypted file, or setting a custom master key.
  • Encryption: Use the encrypt() method to encrypt the file. If you choose to use biometric authentication, it will prompt the user to unlock the file.
  • Decryption: Use the decrypt() method to decrypt the file. Again, biometric authentication can be used for added security.
  • Callbacks: You can set callback functions to handle the completion and failure events during encryption and decryption.
  • Advanced Options: The class provides advanced options such as deleting the original file after encryption, specifying a custom file name, and more.

Example

val encryptFile = EncryptFileClass(context, file)

// Customize encryption settings
encryptFile
    .setResultPath("/custom/path")
    .setFileName("custom_name")
    .setMasterKey("your_custom_key")
    .setCompletedCallback { state -> /* Handle completion */ }
    .setFailureCallback { message -> /* Handle failure */ }

// Encrypt with biometric authentication
val encryptedFilePath = encryptFile.encryptWithBiometric(fragment)

Compatibility

This class is compatible with Android devices running Android 9 (API level 28) and later. Biometric authentication features require Android 10 (API level 29) and later.

Implementation

implementation("com.encrypt.library:securefile:1.0.2")

Note

Ensure that you have the necessary permissions and dependencies configured in your Android project to use the Android Keystore system and biometric authentication.

encrypt-file's People

Contributors

danielecarrozzino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.