Giter Club home page Giter Club logo

determin-ed's Introduction

determin-ed

Create deterministic ed25519 keys from seedfile and password for openssh-key-v1 format

Guessing attacks against stored ssh keys

SSH keys stored on mobile devices and laptop computers are typically password protected, so that if the device is stolen or compromised the attacker has to guess the password in order to use the key. Only raw computing power limits the rate of the attacker's guesses when the key is not stored in a TPM (the TPM should withstand attacks as well). Fortunately there are new password strengthening mechanisms, which try to minimize the computing gap between the most powerful attacker and the weakest user device. Nevertheless, the attacker advantage can be estimated to exceed 30 bits[1] of password entropy, which requires lengthy passwords or inhuman wait times.

What if the CIA filled the tanks with special jet fuel?

What if the attacker would not be able to confirm the key guesses without trying them on the target server?

  • Valid private key decryption should not have structure, i.e. no offline guess attackability
    • For example, RSA fails this as valid p and q have structure: namely they are prime numbers, and getting two prime numbers randomly (1/log(N) each) would be roughly one in a million chance for 1k RSA.
  • The public key should not be in the device. This unfortunately breaks ssh-agent normal behavior.
  • SSHD public key query should be resistant to timing attacks

This proof of concept tool is intended to solve the first two problems. The third one is SSHD devs problem.

Usage

Install the package (go install github.com/joonakannisto/determin-ed)

Create a key seed file. Any tool that can output truly madly random garbage like ssh-keygen is fine for this.

  • ssh-keygen -t ed25519 -f keyseed

Not the most elegant, but doesn't matter, got entropy.

Use determin-ed to create a deterministic SSH key from the seed file

  • determin-ed -out=id_temp keyseed
  • cat id_temp.pub

Put the resulting public key (id_new.pub) to your target server. Delete both id_new* files. Automate a command to create your keys when connecting to target

  • SSH does not have interactive shell command hooks so the example below does not work. If someone could patch this somehow, so that the command could find parent tty and use it, it would be nice.
  • ProxyCommand determin-ed -out=~/.ssh/id_new ~/.ssh/id_rsa.pub ; exec socket %h %p && rm ~/.ssh/id_new*

Can this be used to create password based keys?

Yes. Should you? Definitely not. The public key might not be treated as confidential. OpenSSH supports password authentication. Too bad that J-PAKE is not supported anymore.

[1] Give attacker more time and parallel GPUs worth of 1M$, shittiest hardware for the user and 0.05 s wait time https://litecoin.info/Mining_hardware_comparison

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.