Coder Social home page Coder Social logo

passbertstrengthmeter's Introduction

PassBertStrengthMeter

Introduction

PassBertStrengthMeter is the open source library to apply BERT model to password evaluation. We hope the PassBert model will help solve more password understanding tasks.

Usage

The ServerModel consists the python source code used in our project. We adopt the bert4keras library as our based framework. More details about our PassBERT model can be found in ServerModel/.

The ClintModel is the client meter to evaluate password strength in user's browser. We deploy our PassBert model by Tensorflowjs.

Environment

  • Python 3.7
  • TensorFlow 1.14
  • TensorFlowjs 3.15.0
  • Keras 2.3.1

passbertstrengthmeter's People

Contributors

jedar avatar snow0011 avatar

Stargazers

 avatar  avatar krypto avatar Chih avatar  avatar Ceres avatar Whi1e(l) avatar  avatar  avatar  avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

passbertstrengthmeter's Issues

Configuration Problem "Employ TPG attack"

I am trying to use the script for employing a TPG attack using cmd or testing mode. This is the error raised by keras:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py", line 233, in func_load
    code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./src/tasks/bert4sim.py", line 565, in <module>
    main()
  File "./src/tasks/bert4sim.py", line 547, in main
    model = ModelWrapper(config)
  File "./src/tasks/bert4sim.py", line 285, in __init__
    self.model = self.load_finetune()
  File "./src/tasks/bert4sim.py", line 420, in load_finetune
    return load_model(self.config.model_load, custom_objects=self.custom_objects)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 492, in load_wrapper
    return load_function(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 584, in load_model
    model = _deserialize_model(h5dict, custom_objects, compile)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 274, in _deserialize_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 627, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "/usr/local/lib/python3.6/dist-packages/keras/layers/__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py", line 147, in deserialize_keras_object
    list(custom_objects.items())))
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/network.py", line 1056, in from_config
    process_layer(layer_data)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/network.py", line 1042, in process_layer
    custom_objects=custom_objects)
  File "/usr/local/lib/python3.6/dist-packages/keras/layers/__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py", line 147, in deserialize_keras_object
    list(custom_objects.items())))
  File "/usr/local/lib/python3.6/dist-packages/keras/layers/core.py", line 764, in from_config
    function = func_load(config['function'], globs=globs)
  File "/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py", line 237, in func_load
    code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

and these are the configuration parameters that I have defined:

class Config:
    def __init__(self):
        self.maxlen = 32
        self.batch_size = 128
        self.epochs = 3
        # number of bert layers
        self.layers_num = 4
        # Learning rate
        self.lr = 1e-5
        self.cpu_num = 10
        # bert配置
        self.config_path = '/tmp/PassBertStrengthMeter/ServerModel/config/bert_config.json'
        self.checkpoint_path = ''
        self.label_path = ''
        self.model_save = '/tmp/PassBertStrengthMeter/ServerModel/model/pretrain/'
        self.mode = "cmd" # train, cmd, test
        self.model_load = '/tmp/PassBertStrengthMeter/ServerModel/model/TPG/tpg.h5'
        self.pwd_pairs = ''
        self.output_csv = ''

But probably am I doing something wrong.

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.