Skip to content

wahabaa/keystroke-web-MFA

Repository files navigation

Keystroke Dynamics MFA Website

This website demonstrates keystroke dynamics as an alternative MFA other than the popular OTP or push notification MFAs.

House Keeping

  1. Create a database called Soteria (you can use any name of your choice).
  2. Modify the settings.py file with your newly created database name, user, host and password.
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'soteria', # Set DB Name
        'HOST': 'localhost',
        'PORT': '3306',
        'USER': 'root',
        'PASSWORD': '*****', # Set DB password
    }}
  3. Visit Sendgrid to create an account for sending email.
  4. Follow the guide here on how to set up a new api key.
  5. Modify the code below in the settings.py file with your sendgrid account details such as email, api key and password.
    # Email settings
    DEFAULT_FROM_EMAIL = '[email protected]'
    SERVER_EMAIL = '[email protected]'
    EMAIL_USE_TLS = True
    EMAIL_HOST = 'smtp.sendgrid.net'
    EMAIL_PORT = 587
    EMAIL_HOST_USER = 'apikey'
    EMAIL_HOST_PASSWORD = '***************************'
  6. Visit Twilio and create an account to get an assigned phone number for sending SMS.
  7. Modify the view.py file with your account_sid, auth_token, and assigned phone number (change from +13233363926 to yours). You can find the information on your twilio dashboard.
    def sendSMS(message, phone):
     if '+' not in str(phone):
         phone = '+1' + str(phone)
     account_sid = '*******************************'
     auth_token = '*******************************'
     client = Client(account_sid, auth_token)
     client.messages.create(to=phone, from_='+13233363926', body=message)
  8. House is clean!

Installation

Use the package manager pip to install all required packages.

pip install -r requirements.txt

Allow django to automatically create the database tables using manage.py. This should run successfully if all the House keeping instructions above are followed.

python manage.py makemigrations
python manage.py migrate

Upon a successful migration, you can now run the server. The server should run on http://127.0.0.1:8000.

python manage.py runserver

Usage

Steps to follow for a successful interaction with the website.

  1. Complete Signup.
  2. Login.
  3. Attempt account recovery (forgot password)

NOTE: First 4 logins or account recoveries use OTP as MFA, after which keystroke dynamics is used.

Contributing

Feel free to make changes to the code.

Developer

License

SERL Clarkson, CITER

About

Keystroke dynamics as alternative MFA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published