red-coracle / flask-argon2 Goto Github PK
View Code? Open in Web Editor NEWA Flask extension providing Argon2 hashing and comparison.
License: Other
A Flask extension providing Argon2 hashing and comparison.
License: Other
http://flask.pocoo.org/docs/0.11/extensiondev/#extension-import-transition
from flask.ext.argon2 import Argon2
should now be
from flask_argon2 import Argon2
to avoid deprecation warnings.
Hey, Due to a lack of FreeBSD support for dependencies such as Argon2-cffi-bindings & Argon2-cffi which you use in flask_argon_2, impossible to install on FreeBSD, FreeBSD support would be super interesting in a recent update
Afi.
Could you please tag releases? This makes it more convenient to find the code to specific pypi releases.
It seems like pypi is distributing an old version of the code. When running the following:
PS C:\Users\nieck> pip install flask_argon2
Collecting flask_argon2
Using cached https://files.pythonhosted.org/packages/cd/73/00ed65e317cd93b715c514f61b68960b05dfb87184241e1d7cbb4359f30a/Flask_Argon2-0.1.5.0-py3-none-any.whl
Requirement already satisfied: argon2-cffi in c:\users\nieck\anaconda3\lib\site-packages (from flask_argon2) (19.1.0)
Requirement already satisfied: Flask in c:\users\nieck\anaconda3\lib\site-packages (from flask_argon2) (1.0.3)
Requirement already satisfied: six in c:\users\nieck\anaconda3\lib\site-packages (from argon2-cffi->flask_argon2) (1.11.0)
Requirement already satisfied: cffi>=1.0.0 in c:\users\nieck\anaconda3\lib\site-packages (from argon2-cffi->flask_argon2) (1.11.5)
Requirement already satisfied: click>=5.1 in c:\users\nieck\anaconda3\lib\site-packages (from Flask->flask_argon2) (7.0)
Requirement already satisfied: Werkzeug>=0.14 in c:\users\nieck\anaconda3\lib\site-packages (from Flask->flask_argon2) (0.14.1)
Requirement already satisfied: itsdangerous>=0.24 in c:\users\nieck\anaconda3\lib\site-packages (from Flask->flask_argon2) (0.24)
Requirement already satisfied: Jinja2>=2.10 in c:\users\nieck\anaconda3\lib\site-packages (from Flask->flask_argon2) (2.10)
Requirement already satisfied: pycparser in c:\users\nieck\anaconda3\lib\site-packages (from cffi>=1.0.0->argon2-cffi->flask_argon2) (2.18)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\nieck\anaconda3\lib\site-packages (from Jinja2>=2.10->Flask->flask_argon2) (1.0)
Installing collected packages: flask-argon2
Successfully installed flask-argon2-0.1.5.0
After that the flask_argon2.Argon2 still has no init_app function and flask_argon2.__dict__ shows still the old Version 0.1.3. When looking at the source code file from pypi it is the right version.
I am confused.
Hello,
Seems it's not possible to change default argon2 settings, at least I didn't figure out the way to set them via typical app.config:
# example code (custom flask script)
from flask_argon2 import Argon2
from flask import Flask
app = Flask(__name__)
# example trying to change only memory cost value
app.config['ARGON2_MEMORY_COST'] = 131072
app.config['DEFAULT_MEMORY_COST'] = 131072
crypt_argon2 = Argon2(app)
looks like the Argon2 module is taking pre-set default values from argon2 module (password_hasher.py), and ignores any values passed in via app.config. And unless changing the argon2 module code, I can't find other way to set custom values.
# argon2/password_hasher.py
from .profiles import RFC_9106_LOW_MEMORY
DEFAULT_RANDOM_SALT_LENGTH = RFC_9106_LOW_MEMORY.salt_len
DEFAULT_HASH_LENGTH = RFC_9106_LOW_MEMORY.hash_len
DEFAULT_TIME_COST = RFC_9106_LOW_MEMORY.time_cost
DEFAULT_MEMORY_COST = RFC_9106_LOW_MEMORY.memory_cost
DEFAULT_PARALLELISM = RFC_9106_LOW_MEMORY.parallelism
Values passed to argon2 hash function:
# argon2/profiles.py
# SECOND RECOMMENDED option per RFC 9106.
RFC_9106_LOW_MEMORY = Parameters(
type=Type.ID,
version=19,
salt_len=16,
hash_len=32,
time_cost=3,
memory_cost=65536, # 64 MiB
parallelism=4,
)
Is this intended, or I am doing something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.