Giter VIP home page Giter VIP logo

pkcsencdecrun's Introduction

PkcsEncDecRun - PKCS#11 Encryption & Decryption and Running of Encrypted Commands

Encrypt/decrypt strings using a PKCS#11 smartcard and runs the encrypted command string.

Requirements

  • PKCS#11 compatible smartcard.
  • RSA encryption key on smartcard.

Usage

  1. Prepare: acquire neccessary information.

    1. Insert your smartcard (token).
    2. Determine the serial number of the token.
      • run PkcsEncDecRun.exe info x - it displays the token's serial number.
      • or use Pkcs11Admin: Pkcs11Admin Serial
    3. Determine the ID of a RSA encryption key.
      • run PkcsEncDecRun.exe info x - it displays suitable keys and its IDs.
      • or use Pkcs11Admin: Pkcs11Admin ID
    4. Adjust PkcsEncDecRun.exe.config.
      • Config
  2. Encrypt your command (test it first!) and its arguments; arguments must be delimited by "|~|".

    PkcsEncDecRun.exe enc "c:\Programs\mypgrogram.exe|~|e:\mytresor"
    

    This generates a base64-encoded, encrypted string (encrypted with the RSA public key from the smartcard).

  3. Run or create a batch file (or similar):

    PkcsEncDecRun.exe run yJH3+9nEz...
    

    This will first decrypt the string with the smartcard, and then it runs the command.

PIN as Environment Variable

The PIN can be given in the environment variable PKCS_PIN. Be sure to clear that variable when done!

Example:

set PKCS_PIN=0000

Build

Build Requirements

Build

  • Use MS Visual Studio IDE or msbuild
  • The Release-postbuild produces an all-in-one file ARTEFACT.all.exe which includes all needed DLLs.
  • The file ARTEFACT.all.exe is obfuscated using ConfuserEx.

Tools

  • Pkcs11Admin
  • SoftHSM
    • Hint: make sure the softhsm2.conf is in the same folder of Pkcs11Admin-x64.exe or PkcsEncDecRun.exe.

Author

AST, 02/2018

License

AGPL v3

pkcsencdecrun's People

Contributors

ixtalo avatar

Watchers

 avatar

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.