Code Monkey home page Code Monkey logo

encoding-tools's Introduction

Encoding.Tools

Overview

Encoding.Tools is a web application that makes it easy to chain together various transformations on binary strings.

demo.mp4

Getting Started

The easiest and fastest way to use the application is the hosted version at https://encoding.tools/.

You can also run it locally if you want to use it offline. You need to have Node.js and NPM installed and cloned this repo.

Next, install the NPM dependencies. You only need to run this step once after the initial cloning of the repo, and once more after any updates.

npm install

Once the dependencies are installed, run this command to build the application.

npm run build

In your browser, open the file public/index.html and it should operate locally just like the hosted version.

Development

Dev Setup

If you want to modify Encoding.Tools' code, follow the steps above to get it running locally. Once that it is working, then run:

Once the dependencies are installed, start the server:

npm run dev

The application will now be running on http://localhost:5000/. The server has live reloading, so everytime you edit and save a source file, it will automatically reload the application in your browser.

By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0.

The application is written in SvelteJS which is a Reactive framework that uses a compiler to make DOM updates lean and efficient. If you're new to Svelte, the following are good resources to start learning:

If you're using Visual Studio Code, you should install the official extension Svelte for VS Code. If you are using other editors you may need to install a plugin in order to get syntax highlighting and intellisense.

Adding a New Gadget

Gadgets are the core concept in Encoding.Tools. Each gadget is able to read an input stream of bytes, transform it in some way, and write the results to an output stream. Write a new gadget involves the following steps.

  1. (Optional) If your transform logic depends on an NPM package, install that package: npm install --save-dev <PACKAGE>
  2. (Optional) Create a new gadget family (gadgets are grouped by family in the toolbox)
    1. Copy the imports from one of the existing files, e.g. src/gadgets/ChangeBaseGadget.js.
    2. Create a Base<Family> class that extends BaseGadget and overrides the constructor to set up the family name and CSS class. You may also want to set up the input and output ports in the constructor, if all gadgets in a family will have identical port setups.
  3. Add a new class to the chosen gadget family file (e.g. src/gadgets/ChangeBaseGadget.js) that extends the Base<Family> class of the chosen gadget family.
  4. Override the transform() method. This method should generally:
    1. Read from the gadget's input ports. Each input port has a Buffer that contains the data.
    2. Update the components display state, setting it to DisplayState.null(), DisplayState.error("error message"), or DisplayState.text("text to display").
    3. Write the transformed data as a Buffer to the output ports.
  5. Register the new gadget in GadgetRegistry.js, e.g. gadgetRegistry.register((...args) => new HexEncodeGadget(...args));

License

This application is licensed under the GNU General Public License version 3. See the LICENSE.md file included with this application for more information.

encoding-tools's People

Contributors

dependabot[bot] avatar mehaase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

encoding-tools's Issues

Drag target is not highlighted in Safari

Summary:

On Safari, dragging out a new wire doesn't highlight the target port. It seems like Safari doesn't fire the :hover CSS pseudoselector when the mouse button is down?

If you are reading this and experiencing the same bug, please add a Thumbs Up :thumbs-up: so that I can keep count of people affected by this issue.

Better error handling/reporting

Invalid inputs (such as an odd number of input characters to the hex decoder) are not reported to the user. The gadget with the error just says "null".

example of bad error reporting

Error messages need to be displayed to the user instead of being silently swallowed, and need to decide how subsequent outputs are handled. If there's an error in the hex decode, for example, should downstream components keep the same state, switch to null, or display some other error?


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Load assembly from URL hash

Similar to #17, maybe a precursor: specify static, pre-built assemblies that can be loaded based on URL hash. For example, hxxps://encoding.tools/#base64-decoder would load an input gadget and a base64 decoder gadget into the workspace and pipe them together.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

String Gadgets

Add gadgets for common string transformations, like concatenating strings, substrings, etc.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Encryption Gadgets

Implement some encryption/decryption gadgets, such as AES.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Latch Gadget

Describe the use case:

A common scenario when vulnerability hunting or reverse engineering is to come across some opaque string that you want to modify. So you may need to decode the string first (which may take multiple steps), then you want to edit the string, and then re-encode it (going through the same steps in reverse). It possible to set up a chain of steps that go through decoding and then re-encoding, but there is currently no way to edit a value in the middle of a transformation change.

Describe the solution you'd like to see:

A special type of input gadget that has an input port and a "latch" button. A user can edit the buffer at will. When the latch button is clicked, the data on the input port button overwrites the input's edit buffer.

Describe the alternatives:

The way I work around this right now is by creating two inputs and copy/pasting from the last decode step into the second input. The "latch" gadget would just be an elegant way to copy/paste into an input gadget.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

SHA2 Gadget

The project has a SHA2 gadget but it is fixed at 256 bit digests. There should be an option to select digest size: 224, 256, 384, or 512.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Stand-alone version

For offline / airgapped / sensitive use cases, it would be useful to have a downloadable version to run locally.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Port to a framework

I originally wrote this using bare DOM since Angular was wayyyy overkill, but there are some funky issues resulting from my half-baked DOM wrapper. Consider switching to VueJS or SvelteJS.

Decode unix timestamp

When working with tokens from web applications, I frequently come across Unix timestamps. It would be nice to have a timestamp decoder that turns it into an ISO8601 string.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Refactor gadget base class

Most of the gadgets have a lot of duplicated code and really only a few lines of unique implementation (e.g. MD5 and SHA1 gadgets differ by only a few lines of code)., This is a result of trying to get this project done on a short timeline. It would be faster and easier to create new gadgets if the duplicated code was factored out.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Pretty printer gadgets

When working with strings from web applications, I sometimes end up with a JSON or XML string. It would be nice to have a pretty printer gadget that could make these strings easier to read.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Synchronize highlighed text between gadgets.

Let's say we have the following gadgets: input โ†’ hex decode โ†’ url encode. In the input field we type 706172616d3d666f6f. Then the hex decoder will show param=foo. Then URL encoder will show param%3Dfoo. Maybe you wonder where did %3D come from, so you highlight those three characters.

Right now, the other gadgets won't do anything, but it would be pretty cool if they could highlight the corresponding parts of their data. E.g. the hex decoder would highlight =, and the input gadget would highlight 3d.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

SHA3 Gadget

Add a SHA-3 gadget.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Save and share assemblies

It might be nice to be able to save an assembly (i.e. a collection of gadgets that a user has wired together) and be able to load it later. Of course we don't keep any server-side state, so it would need to be saved somewhere else, either HTML5 local storage or maybe something like a github gist?

Once saved, could the assemblies be shared with other users? Maybe by pointing to the gist ID? Or encoding the entire assembly into a URL parameter?


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Resizable gadgets

It would be nice if gadgets could be resized. Sometimes the content is too big to fit.

input gadget with scollbar


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Abandoned ?

I was wondering if this project has been abandoned because it is very interesting and has potential but I have seen that there have not been any commits on this.

this seems very similar to cyberchef or my text format wizard, but a graphical version, which intrigues me.

Change Of Base Gadgets

The project already has Hex and Base64 codecs. Add other change-of-base gadgets, such as binary, base32, base52, base85, etc.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

HTML Gadget

The existing HTML gadget only encodes a fixed set of HTML entities. It should have options for things like using named entities vs numbered entities, whether to encode only reserved characters or all characters, etc.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

URL encoder gadget

The project has a URL encoder but it only encodes unsafe characters. There should be an option to choose the level of encoding, i.e. encode all, encode path component, etc.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Support touchscreen devices

The application has zero support for touch screens. It probably wouldn't be very useful on phones and other small screens, but I could see this being usable on tablets. Should we add support for touchscreen devices?


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Compression Gadgets

Implement some compression gadgets, e.g. gzip and gunzip.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Set up Hot Module Reloading (HMR)

This would be great for DX. The Svelte FAQ says:

How do I do hot module reloading? permalink
We recommend using SvelteKit, which supports HMR out of the box and is built on top of Vite
and svelte-hmr. There are also community plugins for rollup and webpack.

The rollup link is: https://github.com/rixo/rollup-plugin-svelte-hot


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

KDF Gadgets

Add some gadgets for various key derivation functions (KDFs), such as Bcrypt, PBKDF2, scrypt, etc. This may need to be broken up into multiple issues.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Hex Viewer/Editor Gadget

Add a hex viewer/editor that will display binary data in hex format with column breaks and ASCII on the side, similar to xxd.


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

Add a copy button to gadgets

It would be nice if the output of a gadget could be copied with a single click. Here's an MD5 gadget:

md5 gadget

The GitHub UI has an example of a "copy to clipboard" button. Something like this would work in a gadget:

github copy button


If you are reading this and want to express positive or negative feedback, please leave a Thumbs Up or Thumbs Down so that I can keep track of demand. Please do not reply just to say +1 or -1. Thanks!

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.