All Projects → aeolwyr → Tergent

aeolwyr / Tergent

Licence: gpl-3.0
A cryptoki library that uses Android keystore as the backend

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Tergent

Aidlearning Framework
🔥🔥AidLearning is a powerful mobile development platform, AidLearning builds a linux env supporting GUI, deep learning and visual IDE on Android...Now Aid supports OpenCL (GPU+NPU) for high performance acceleration...Linux on Android or HarmonyOS
Stars: ✭ 4,537 (+11242.5%)
Mutual labels:  termux
Impulse
💣 Impulse Denial-of-service ToolKit
Stars: ✭ 538 (+1245%)
Mutual labels:  termux
Bombers
SMS/Email/Whatsapp/Twitter/Instagram bombers Collection 💣💣💣 💥
Stars: ✭ 647 (+1517.5%)
Mutual labels:  termux
Gbt
Highly configurable prompt builder for Bash, ZSH and PowerShell written in Go.
Stars: ✭ 457 (+1042.5%)
Mutual labels:  termux
Termux Packages
A build system and primary set of packages for Termux.
Stars: ✭ 6,916 (+17190%)
Mutual labels:  termux
Termux Adb
Install ADB & FastBoot Tools in Termux!
Stars: ✭ 555 (+1287.5%)
Mutual labels:  termux
Infect
Infect Any Android Device With Virus From Link In Termux
Stars: ✭ 409 (+922.5%)
Mutual labels:  termux
Snoop
Snoop — инструмент разведки на основе открытых данных (OSINT world)
Stars: ✭ 886 (+2115%)
Mutual labels:  termux
Onex
onex is a hacking tool installer and package manager for hackers. Onex is a library of all hacking tools for Termux and other Linux distributions. onex can install any third party tool or any hacking tool for you.
Stars: ✭ 537 (+1242.5%)
Mutual labels:  termux
Termuxarch
You can use setupTermuxArch.bash 📲 to install Arch Linux in Amazon, Android, Chromebook and Windows. https://sdrausty.github.io/TermuxArch/docs/install
Stars: ✭ 653 (+1532.5%)
Mutual labels:  termux
Hackerpro
All in One Hacking Tool for Linux & Android (Termux). Make your linux environment into a Hacking Machine. Hackers are welcome in our blog
Stars: ✭ 474 (+1085%)
Mutual labels:  termux
Termux Desktop
Setup A Beautiful Desktop/GUI In Termux
Stars: ✭ 527 (+1217.5%)
Mutual labels:  termux
Anlinux App
AnLinux allow you to run Linux on Android without root access.
Stars: ✭ 614 (+1435%)
Mutual labels:  termux
Telegram Scraper
telegram group scraper tool. fetch all information about group members
Stars: ✭ 450 (+1025%)
Mutual labels:  termux
Nexphisher
Advanced Phishing tool for Linux & Termux
Stars: ✭ 822 (+1955%)
Mutual labels:  termux
Andronixorigin
This is the official repository for the back end of the Andronix app 🚀. Here you can know all the scripts you're installing 😎
Stars: ✭ 427 (+967.5%)
Mutual labels:  termux
Easy hack
Hack the World using Termux
Stars: ✭ 549 (+1272.5%)
Mutual labels:  termux
Termux App
Termux - a terminal emulator application for Android OS extendible by variety of packages.
Stars: ✭ 10,088 (+25120%)
Mutual labels:  termux
Hacktronian
Tools for Hacking
Stars: ✭ 857 (+2042.5%)
Mutual labels:  termux
Atilo
Linux installer for termux
Stars: ✭ 629 (+1472.5%)
Mutual labels:  termux

tergent - a cryptoki library for termux keystore

A cryptoki/PKCS#11 library for Termux that uses Android Keystore as its backend.

This library enables the use of keys securely stored in termux-api with PKCS#11 protocol capable applications. These include the applications provided by openssh, such as ssh and scp.

Tergent does not (and cannot) access your private keys as they are stored inside the secure hardware. In fact, they can never leave the chip even with root privileges, thanks to extraction preventation.
Cryptographic actions are performed by the hardware itself.

This library is aimed to be compliant with PKCS#11 version 2.40. For now it implements all the APIs required for ssh and the related applications to function. If you encounter any issues trying to use tergent with any other PKCS#11 capable application, please open a bug report.

Compiling

Install Rust and Android NDK.
You will need to configure cargo with the correct locations for "ar" and "linker", you can follow this page up to and including the rustup target add ... command:
https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-21-rust-on-android.html
Then this project can be compiled with the command cargo build --target=aarch64-linux-android (or any other Android target).

Alternatively, you can download a precompiled deb package from the releases page.

Upgrading from 0.1

Keys generated for tergent 0.1 will not work for the latest version. If you do not want to lose access to your server, generate new keys using step 2 below and copy it to your server before upgrading.
If you have already upgraded, you can download a copy of an older version from the releases page.
After upgrading, any modifications made in .bash_profile or similar files should be removed. There is no need to keep running a background process anymore.

Usage

  1. Make sure you have the latest version of Termux:API installed. Don't forget to install the scripts using the command pkg install termux-api.

  2. As of now termux-keystore cannot generate keys compatible with tergent. Use one of these commands instead:

  • To generate an RSA key:
/data/data/com.termux/files/usr/libexec/termux-api Keystore -e command generate -e alias ALIAS -e algorithm ALGORITHM --ei purposes 12 --esa digests NONE,SHA-1,SHA-256,SHA-384,SHA-512 --ei size SIZE --ei validity VALIDITY
  • To generate an EC key:
/data/data/com.termux/files/usr/libexec/termux-api Keystore -e command generate -e alias ALIAS -e algorithm EC --ei purposes 12 --esa digests NONE,SHA-1,SHA-256,SHA-384,SHA-512 -e curve CURVE --ei validity VALIDITY
  • ALIAS is the name you want to give to the key.
  • SIZE can be 2048, 3072 or 4096, this is only used for RSA keys.
  • CURVE can be secp256r1, secp384r1 or secp521r1, this determines the EC key size.
  • VALIDITY can be used for user validity, see Auto-locking below. Use 0 to disable.
  1. List the keys to verify using the standard ssh tool: ssh-keygen -D $PREFIX/lib/libtergent.so. Even though the command is called ssh-keygen, -D switch lists cryptoki keys instead of generating new keys.

  2. Copy the public key to your server.

    1. First export the public keys using: ssh-keygen -D $PREFIX/lib/libtergent.so > keys.pub.
    2. Optionally, remove any keys from the generated file using a text editor if needed: nano keys.pub.
    3. Copy the keys to your server using ssh-copy-id -f -i keys.pub example.com.
  3. Connect to your server using the command ssh -I $PREFIX/lib/libtergent.so example.com.

To make ssh remember the library path, modify your ~/.ssh/config file. For a single host:

Host example.com
	PKCS11Provider /data/data/com.termux/files/usr/lib/libtergent.so

Or alternatively you can make tergent apply to all connections:

Host *
	PKCS11Provider /data/data/com.termux/files/usr/lib/libtergent.so

After saving this file you can just run ssh example.com to connect.

How do I...

  • list keys: run either ssh-keygen -D $PREFIX/lib/libtergent.so or termux-keystore list
  • create a new key: see step 2 from instructions above
  • use a key: run ssh -I $PREFIX/lib/libtergent.so
  • delete a key: use termux-keystore delete
  • import a key: not supported, generate a new key instead

Auto-locking

tergent does not provide password protected sessions yet. However, Android provides a mechanism to automatically lock the keys after a specified time has passed since the last device unlock. To take advantage of this feature, use the flag while generating the keys, e.g. --ei validity 10 for a 10-second lock. In this case, the keys are usable only for 10 seconds after the phone is unlocked. To unlock the keys after this time has passed, simply re-lock and unlock your device again.

Alternatively, you can invoke a biometric prompt (fingerprint or face unlock) which might also reset this timer depending on your device. termux includes the termux-fingerprint command which can be used for this purpose.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].