Chepy - The Hacker's Toolbox
Written by Nikos Vaggalis   
Thursday, 19 October 2023

Chepy is a Python library and is the CLI equivalent of GCHQ's CyberChef multi-hacker-tool.

To give some context, CyberChef is an open source tool that runs in browser released by GCHQ - yes, the British government intelligence agency. With CyberChef you can do encoding, encrypting and converting data formats as examined in detail in "CyberChef - The Developer's Ultimate Toolbox":

CyberChef is a general purpose tool, therefore more useful than the specialized and niche Ghidra. It's a tool that provides functionality that every developer needs for their day-to-day workload.

That range of functionality is staggeringly large, ranging from the popular toBase64/fromBase64 and URL encode/decode, to encryption with AES/DES/Blowfish and JWT, to Arithmetic and Logic with calc and bitwise operations, up to Language and Charset conversions.

CyberChef, and its Chepy implementation, can be used in popular scenarios like: 

  • Decode a Base64-encoded string
  • Convert a date and time to a different time zone
  • Parse a IPv6 address
  • Convert data from a hexdump, then decompress
  • Decrypt and disassemble shellcode
  • Display multiple timestamps as full dates
  • Carry out different operations on data of different types
  • Use parts of the input as arguments to operations
  • Perform AES decryption, extracting the IV from the beginning of the cipher stream
  • Automatically detect several layers of nested encoding

Such a tool would be particularly handy when taking part in Hacking CTF competitions.

Chepy is CyberChef but being offered as a Python library and a handy cli, trying to mirror some of the capabilities of CyberChef. That means that it (still) doesn't support the full spectrum of CyberChef's capabilities, but it is slowly getting there.

As a library it meansn that whereas you did your crypto operations through the browser, now you do them through code. This example will illustrate the point:

The advantage is that you can write scripts that automate or chain operations, something very useful when tackling CTFs as we examined in "Play & Learn With CryptoHack"; a fun way to learn cryptography and also acquire valuable CTF skills, through a series of puzzles which challenges you to break bad implementations of "modern" crypto, such as AES, RSA, and Elliptic-curves.

CryptoHack suggests that While you can use converters found online for your encoding/decoding needs, like CyberChef, it is suggested you use a programming language in coding your solution. The platform prefers Python 3 and provides snippets of Python source code which you can adapt to your own purposes. As such Chepy is spot on on the requirements of CryptoHack.

All in all, Chepy compared to CyberChef has distinct advantages as well as disadvantages:

Advantages

  • Chepy is pure python with a supporting and accessible python api
  • Chepy has a CLI
  • Chepy CLI has full autocompletion.
  • Supports pe, elf, and other various file format specific parsing.
  • Extendable via plugins
  • Infinitely scalable as it can leverage the full Python library.
  • Chepy can interface with the full Cyberchef web app to a certain degree. It is easy to move from Chepy to Cyberchef if need be.
  • The Chepy python library is significantly faster than the Cyberchef Node library.
  • Works with HTTP/S requests without CORS issues.

Disadvantages

  • Chepy is not a web app (at least for now).
  • Chepy does not offer every single thing that Cyberchef does
  • Chepy does not have the magic method (at the moment)

Chepy can be installed with pip, git and Docker. Full instructions on the project's Github repo.

 

More Information

Chepy

Related Articles

CyberChef - The Developer's Ultimate Toolbox

Play & Learn With CryptoHack

NSA's Cybersecurity Curriculum

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Rust Twice As Productive As C++
03/04/2024

Google director of engineering, Lars Bergstrom, gave a talk at the recent Rust Nation UK conference and claimed that Rust was twice as productive as C++. Given how good Google is at C++, this is quite [ ... ]



Amazon Ending Alexa Skills Payments
12/04/2024

Amazon has told developers who are signed up to the Alexa Developer Rewards Program that their monthly payments will end at the end of June. The announcement follows a decision to end the program unde [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info