Giter Site home page Giter Site logo

elliotwutingfeng / fernet Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 0.0 24 KB

A Dart library for encrypting and decrypting messages using the Fernet scheme.

Home Page: https://pub.dev/packages/fernet

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.87% Dart 99.13%
aes-128-cbc cryptography decryption encryption hmac-sha256 secret pkcs7

fernet's Introduction

fernet

Pub Package Coveralls LICENSE

A Dart library for encrypting and decrypting messages using the Fernet scheme.

This is a direct port of the Fernet implementation in the Python cryptography library.

Requirements

  • Dart SDK: 3.0+

Using passwords with Fernet

It is possible to use passwords with Fernet. To do this, you need to run the password through a key derivation function such as PBKDF2HMAC, bcrypt, scrypt, or argon2. An example with argon2id is provided at example/password.dart.

Implementation

Fernet is built on top of a number of standard cryptographic primitives. Specifically it uses:

  • AES in CBC mode with a 128-bit key for encryption; using PKCS7 padding.

  • HMAC using SHA256 for authentication.

  • Initialization vectors are generated using Random.secure().

For complete details consult the specification.

The cryptographic primitives used in this library are provided by pointycastle.

Limitations

Fernet is ideal for encrypting data that easily fits in memory. As a design feature it does not expose unauthenticated bytes. This means that the complete message contents must be available in memory, making Fernet generally unsuitable for very large files at this time.

Credits

This library uses code from other open-source projects. The copyright statements of these open-source projects are listed in CREDITS.md. Most of the documentation and implementation details have been adapted from the Python cryptography library.

fernet's People

Contributors

elliotwutingfeng avatar

Stargazers

Keith Yang avatar  avatar

fernet's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • dart-lang/setup-dart v1
  • coverallsapp/github-action v2
  • actions/checkout v4
.github/workflows/publish.yml
  • dart-lang/setup-dart v1
pub
pubspec.yaml
  • pointycastle ^3.7.4
  • coverage ^1.7.2
  • lints ^3.0.0
  • test ^1.25.2
  • dart ^3.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.