CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

Bug report: Entering a negative amount for the ROT13 operation leads to an incorrect toast message

Open gregsadetsky opened this issue 2 years ago • 2 comments

Describe the bug

When using the ROT13 operation, if you enter a negative "amount" (i.e. the amount that is 13 by default), an incorrect "toast" message appears at the bottom (see below for screenshot). An error also appears in the console: "Invalid ingredient value. Not a number: NaN"

To Reproduce

  1. go to https://gchq.github.io/CyberChef/#recipe=ROT13(true,true,false,-8)&input=VGhpcyBpcyBhIHRlc3Q
  2. in the "Amount" input in the ROT13 operation, delete the "8" and write "7" for example (making the amount -7)
  3. you will see an error in the console, and a toast message consisting of "[object Object]" will appear at the bottom

Expected behaviour

The expected behavior would be for no message to appear at the bottom, or for a human-readable one to appear.

Screenshots

image

Desktop (if relevant, please complete the following information):

  • OS: macOS 12.7
  • Browser: Desktop Chrome Version 119.0.6045.159 (Official Build) (arm64)
  • CyberChef version: Version 10.5.2

Additional context

n/a

gregsadetsky avatar Nov 28 '23 23:11 gregsadetsky

Several other operations have this same behavior. For example: ROT47, Affine Cipher Encode, LS47...

While I agree that displaying [object Object] is confusion and probably inappropriate, the question is: what should the UI do in these cases?

profbbrown avatar Jul 09 '24 04:07 profbbrown