Giter VIP home page Giter VIP logo

Comments (3)

AKushWarrior avatar AKushWarrior commented on May 28, 2024

It does, yeah. The AES offered by steel_crypt is AES-256.

You can use the AesCrypt class: https://pub.dev/documentation/steel_crypt/latest/steel_crypt/AesCrypt-class.html
Or the AesCryptRaw class: https://pub.dev/documentation/steel_crypt/latest/steel_crypt/AesCryptRaw-class.html

They both have a property gcm which can be used to access a GCM encryptor based on the key you provided.

from steel_crypt.

ravitejaavv avatar ravitejaavv commented on May 28, 2024

How do i pass my own password?
For example:
String password = "password123";
String encryptedString = aes.gcm.encrypt(inp: 'words', password: password);

from steel_crypt.

AKushWarrior avatar AKushWarrior commented on May 28, 2024

you'll need to hash the password (look into PassCrypt: https://pub.dev/documentation/steel_crypt/latest/steel_crypt/PassCrypt-class.html). The resultant 32 byte key is secure and usable for AES.

The outline of the code looks like this:

hash password -> get key
make aes encryptor using key + padding
then:
aes.gcm.encrypt(inp: 'words', iv: 'base64ivhere');
store(encrypted + iv); //where + is append

To decrypt, it's a similar process: hash the password to get the key, separate the iv from the encrypted text, and pass in the text and iv to the decrypt method.

You will have to find a way to salt the password; usually that's some device specific identifier that remains constant.

If you don't understand any of this process, go read up on cryptographic algorithms. Specifically: read up on password hashing and AES-GCM, and effective usage of them in production. You NEED IVs that are unique, and you NEED salts which are consistent and unique to a given user.

from steel_crypt.

Related Issues (20)

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.