CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

Feature request: Inverting characters case

Open R-eyes opened this issue 3 years ago • 4 comments

Hello,

Some obfuscation techniques used by malicious code consist of inverting the case of characters after passing them to base64 or other encoding scheme: (Upper --> Lower and Lower --> Upper)

It would be nice to have a Operation : Inverting characters case

Also, this could be used by the Magic Operation.

Thanks.

R-eyes avatar Jan 16 '22 04:01 R-eyes

For example : vgHPCYbcyxnLnJqGBwvHBNmGC29TzxrOAw5NlG== would become : VGhpcyBCYXNlNjQgbWVhbnMgc29tZXRoaW5nLg==

R-eyes avatar Apr 09 '22 23:04 R-eyes

Not a single operation but here's a recipe that will do the same.

[{"op":"Fork","args":["","\\n",false]},{"op":"Conditional Jump","args":["[A-Z]",false,"tolowercase",1]},{"op":"To Upper case","args":["All"]},{"op":"Jump","args":["end",1]},{"op":"Label","args":["tolowercase"]},{"op":"To Lower case","args":[]},{"op":"Label","args":["end"]},{"op":"Merge","args":[]},{"op":"Find / Replace","args":[{"option":"Extended (\\n, \\t, \\x...)","string":"\\n"},"",true,false,true,false]}]

mattnotmax avatar Apr 11 '22 03:04 mattnotmax

Nice recipe. Thanks.

R-eyes avatar Apr 20 '22 02:04 R-eyes

ooh, can be done slightly better by forking each character: [{"op":"Fork","args":["","",false]},{"op":"Conditional Jump","args":["[A-Z]",false,"tolowercase",1]},{"op":"To Upper case","args":["All"]},{"op":"Jump","args":["end",1]},{"op":"Label","args":["tolowercase"]},{"op":"To Lower case","args":[]},{"op":"Label","args":["end"]},{"op":"Merge","args":[]}]

mattnotmax avatar Apr 22 '22 11:04 mattnotmax

This has been added in 10.1.0 here: #1499

ParkerM avatar Mar 27 '23 23:03 ParkerM

awesome :) thanks a lot for your help.

R-eyes avatar Mar 30 '23 01:03 R-eyes