OperationConfig.js 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170
  1. var FlowControl = require("../core/FlowControl.js"),
  2. Base = require("../operations/Base.js"),
  3. Base58 = require("../operations/Base58.js"),
  4. Base64 = require("../operations/Base64.js"),
  5. BitwiseOp = require("../operations/BitwiseOp.js"),
  6. ByteRepr = require("../operations/ByteRepr.js"),
  7. CharEnc = require("../operations/CharEnc.js"),
  8. Checksum = require("../operations/Checksum.js"),
  9. Cipher = require("../operations/Cipher.js"),
  10. Code = require("../operations/Code.js"),
  11. Compress = require("../operations/Compress.js"),
  12. Convert = require("../operations/Convert.js"),
  13. DateTime = require("../operations/DateTime.js"),
  14. Endian = require("../operations/Endian.js"),
  15. Entropy = require("../operations/Entropy.js"),
  16. Extract = require("../operations/Extract.js"),
  17. FileType = require("../operations/FileType.js"),
  18. Hash = require("../operations/Hash.js"),
  19. Hexdump = require("../operations/Hexdump.js"),
  20. HTML = require("../operations/HTML.js"),
  21. HTTP = require("../operations/HTTP.js"),
  22. IP = require("../operations/IP.js"),
  23. JS = require("../operations/JS.js"),
  24. MAC = require("../operations/MAC.js"),
  25. MorseCode = require("../operations/MorseCode.js"),
  26. NetBIOS = require("../operations/NetBIOS.js"),
  27. Numberwang = require("../operations/Numberwang.js"),
  28. OS = require("../operations/OS.js"),
  29. PublicKey = require("../operations/PublicKey.js"),
  30. Punycode = require("../operations/Punycode.js"),
  31. QuotedPrintable = require("../operations/QuotedPrintable.js"),
  32. Rotate = require("../operations/Rotate.js"),
  33. SeqUtils = require("../operations/SeqUtils.js"),
  34. StrUtils = require("../operations/StrUtils.js"),
  35. Tidy = require("../operations/Tidy.js"),
  36. Unicode = require("../operations/Unicode.js"),
  37. URL_ = require("../operations/URL.js"),
  38. UUID = require("../operations/UUID.js");
  39. /**
  40. * Type definition for an OpConf.
  41. *
  42. * @typedef {Object} OpConf
  43. * @property {html} description - A description of the operation with optional HTML tags
  44. * @property {Function} run - The function which can be called the run the operation
  45. * @property {string} inputType
  46. * @property {string} outputType
  47. * @property {Function|boolean} [highlight] - A function to calculate the highlight offset, or true
  48. * if the offset does not change
  49. * @property {Function|boolean} [highlightReverse] - A function to calculate the highlight offset
  50. * in reverse, or true if the offset does not change
  51. * @property {boolean} [flowControl] - True if the operation is for Flow Control
  52. * @property {ArgConf[]} [args] - A list of configuration objects for the arguments
  53. */
  54. /**
  55. * Type definition for an ArgConf.
  56. *
  57. * @typedef {Object} ArgConf
  58. * @property {string} name - The display name of the argument
  59. * @property {string} type - The data type of the argument
  60. * @property {*} value
  61. * @property {number[]} [disableArgs] - A list of the indices of the operation's arguments which
  62. * should be toggled on or off when this argument is changed
  63. * @property {boolean} [disabled] - Whether or not this argument starts off disabled
  64. */
  65. /**
  66. * Operation configuration objects.
  67. *
  68. * @author n1474335 [n1474335@gmail.com]
  69. * @copyright Crown Copyright 2016
  70. * @license Apache-2.0
  71. *
  72. * @constant
  73. * @type {Object.<string, OpConf>}
  74. */
  75. var OperationConfig = module.exports = {
  76. "Fork": {
  77. description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",
  78. run: FlowControl.runFork,
  79. inputType: "string",
  80. outputType: "string",
  81. flowControl: true,
  82. args: [
  83. {
  84. name: "Split delimiter",
  85. type: "binaryShortString",
  86. value: FlowControl.FORK_DELIM
  87. },
  88. {
  89. name: "Merge delimiter",
  90. type: "binaryShortString",
  91. value: FlowControl.MERGE_DELIM
  92. },
  93. {
  94. name: "Ignore errors",
  95. type: "boolean",
  96. value: FlowControl.FORK_IGNORE_ERRORS
  97. }
  98. ]
  99. },
  100. "Merge": {
  101. description: "Consolidate all branches back into a single trunk. The opposite of Fork.",
  102. run: FlowControl.runMerge,
  103. inputType: "string",
  104. outputType: "string",
  105. flowControl: true,
  106. args: []
  107. },
  108. "Jump": {
  109. description: "Jump forwards or backwards over the specified number of operations.",
  110. run: FlowControl.runJump,
  111. inputType: "string",
  112. outputType: "string",
  113. flowControl: true,
  114. args: [
  115. {
  116. name: "Number of operations to jump over",
  117. type: "number",
  118. value: FlowControl.JUMP_NUM
  119. },
  120. {
  121. name: "Maximum jumps (if jumping backwards)",
  122. type: "number",
  123. value: FlowControl.MAX_JUMPS
  124. }
  125. ]
  126. },
  127. "Conditional Jump": {
  128. description: "Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.",
  129. run: FlowControl.runCondJump,
  130. inputType: "string",
  131. outputType: "string",
  132. flowControl: true,
  133. args: [
  134. {
  135. name: "Match (regex)",
  136. type: "string",
  137. value: ""
  138. },
  139. {
  140. name: "Number of operations to jump over if match found",
  141. type: "number",
  142. value: FlowControl.JUMP_NUM
  143. },
  144. {
  145. name: "Maximum jumps (if jumping backwards)",
  146. type: "number",
  147. value: FlowControl.MAX_JUMPS
  148. }
  149. ]
  150. },
  151. "Return": {
  152. description: "End execution of operations at this point in the recipe.",
  153. run: FlowControl.runReturn,
  154. inputType: "string",
  155. outputType: "string",
  156. flowControl: true,
  157. args: []
  158. },
  159. "From Base64": {
  160. description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation decodes data from an ASCII Base64 string back into its raw format.<br><br>e.g. <code>aGVsbG8=</code> becomes <code>hello</code>",
  161. run: Base64.runFrom,
  162. highlight: Base64.highlightFrom,
  163. highlightReverse: Base64.highlightTo,
  164. inputType: "string",
  165. outputType: "byteArray",
  166. args: [
  167. {
  168. name: "Alphabet",
  169. type: "editableOption",
  170. value: Base64.ALPHABET_OPTIONS
  171. },
  172. {
  173. name: "Remove non&#8209;alphabet chars",
  174. type: "boolean",
  175. value: Base64.REMOVE_NON_ALPH_CHARS
  176. }
  177. ]
  178. },
  179. "To Base64": {
  180. description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation encodes data in an ASCII Base64 string.<br><br>e.g. <code>hello</code> becomes <code>aGVsbG8=</code>",
  181. run: Base64.runTo,
  182. highlight: Base64.highlightTo,
  183. highlightReverse: Base64.highlightFrom,
  184. inputType: "byteArray",
  185. outputType: "string",
  186. args: [
  187. {
  188. name: "Alphabet",
  189. type: "editableOption",
  190. value: Base64.ALPHABET_OPTIONS
  191. },
  192. ]
  193. },
  194. "From Base58": {
  195. description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It differs from Base64 by removing easily misread characters (i.e. l, I, 0 and O) to improve human readability.<br><br>This operation decodes data from an ASCII string (with an alphabet of your choosing, presets included) back into its raw form.<br><br>e.g. <code>StV1DL6CwTryKyV</code> becomes <code>hello world</code><br><br>Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
  196. run: Base58.runFrom,
  197. inputType: "string",
  198. outputType: "byteArray",
  199. args: [
  200. {
  201. name: "Alphabet",
  202. type: "editableOption",
  203. value: Base58.ALPHABET_OPTIONS
  204. },
  205. {
  206. name: "Remove non&#8209;alphabet chars",
  207. type: "boolean",
  208. value: Base58.REMOVE_NON_ALPH_CHARS
  209. }
  210. ]
  211. },
  212. "To Base58": {
  213. description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It differs from Base64 by removing easily misread characters (i.e. l, I, 0 and O) to improve human readability.<br><br>This operation encodes data in an ASCII string (with an alphabet of your choosing, presets included).<br><br>e.g. <code>hello world</code> becomes <code>StV1DL6CwTryKyV</code><br><br>Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
  214. run: Base58.runTo,
  215. inputType: "byteArray",
  216. outputType: "string",
  217. args: [
  218. {
  219. name: "Alphabet",
  220. type: "editableOption",
  221. value: Base58.ALPHABET_OPTIONS
  222. },
  223. ]
  224. },
  225. "From Base32": {
  226. description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
  227. run: Base64.runFrom32,
  228. inputType: "string",
  229. outputType: "byteArray",
  230. args: [
  231. {
  232. name: "Alphabet",
  233. type: "binaryString",
  234. value: Base64.BASE32_ALPHABET
  235. },
  236. {
  237. name: "Remove non&#8209;alphabet chars",
  238. type: "boolean",
  239. value: Base64.REMOVE_NON_ALPH_CHARS
  240. }
  241. ]
  242. },
  243. "To Base32": {
  244. description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
  245. run: Base64.runTo32,
  246. inputType: "byteArray",
  247. outputType: "string",
  248. args: [
  249. {
  250. name: "Alphabet",
  251. type: "binaryString",
  252. value: Base64.BASE32_ALPHABET
  253. }
  254. ]
  255. },
  256. "Show Base64 offsets": {
  257. description: "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.<br><br>This operation shows all possible offsets for a given string so that each possible encoding can be considered.",
  258. run: Base64.runOffsets,
  259. inputType: "byteArray",
  260. outputType: "html",
  261. args: [
  262. {
  263. name: "Alphabet",
  264. type: "binaryString",
  265. value: Base64.ALPHABET
  266. },
  267. {
  268. name: "Show variable chars and padding",
  269. type: "boolean",
  270. value: Base64.OFFSETS_SHOW_VARIABLE
  271. }
  272. ]
  273. },
  274. "XOR": {
  275. description: "XOR the input with the given key.<br>e.g. <code>fe023da5</code><br><br><strong>Options</strong><br><u>Null preserving:</u> If the current byte is 0x00 or the same as the key, skip it.<br><br><u>Scheme:</u><ul><li>Standard - key is unchanged after each round</li><li>Input differential - key is set to the value of the previous unprocessed byte</li><li>Output differential - key is set to the value of the previous processed byte</li></ul>",
  276. run: BitwiseOp.runXor,
  277. highlight: true,
  278. highlightReverse: true,
  279. inputType: "byteArray",
  280. outputType: "byteArray",
  281. args: [
  282. {
  283. name: "Key",
  284. type: "toggleString",
  285. value: "",
  286. toggleValues: BitwiseOp.KEY_FORMAT
  287. },
  288. {
  289. name: "Scheme",
  290. type: "option",
  291. value: BitwiseOp.XOR_SCHEME
  292. },
  293. {
  294. name: "Null preserving",
  295. type: "boolean",
  296. value: BitwiseOp.XOR_PRESERVE_NULLS
  297. }
  298. ]
  299. },
  300. "XOR Brute Force": {
  301. description: "Enumerate all possible XOR solutions. Current maximum key length is 2 due to browser performance.<br><br>Optionally enter a regex string that you expect to find in the plaintext to filter results (crib).",
  302. run: BitwiseOp.runXorBrute,
  303. inputType: "byteArray",
  304. outputType: "string",
  305. args: [
  306. {
  307. name: "Key length",
  308. type: "option",
  309. value: BitwiseOp.XOR_BRUTE_KEY_LENGTH
  310. },
  311. {
  312. name: "Length of sample",
  313. type: "number",
  314. value: BitwiseOp.XOR_BRUTE_SAMPLE_LENGTH
  315. },
  316. {
  317. name: "Offset of sample",
  318. type: "number",
  319. value: BitwiseOp.XOR_BRUTE_SAMPLE_OFFSET
  320. },
  321. {
  322. name: "Null preserving",
  323. type: "boolean",
  324. value: BitwiseOp.XOR_PRESERVE_NULLS
  325. },
  326. {
  327. name: "Differential",
  328. type: "boolean",
  329. value: BitwiseOp.XOR_DIFFERENTIAL
  330. },
  331. {
  332. name: "Crib (known plaintext string)",
  333. type: "binaryString",
  334. value: ""
  335. },
  336. {
  337. name: "Print key",
  338. type: "boolean",
  339. value: BitwiseOp.XOR_BRUTE_PRINT_KEY
  340. },
  341. {
  342. name: "Output as hex",
  343. type: "boolean",
  344. value: BitwiseOp.XOR_BRUTE_OUTPUT_HEX
  345. }
  346. ]
  347. },
  348. "NOT": {
  349. description: "Returns the inverse of each byte.",
  350. run: BitwiseOp.runNot,
  351. highlight: true,
  352. highlightReverse: true,
  353. inputType: "byteArray",
  354. outputType: "byteArray",
  355. args: []
  356. },
  357. "AND": {
  358. description: "AND the input with the given key.<br>e.g. <code>fe023da5</code>",
  359. run: BitwiseOp.runAnd,
  360. highlight: true,
  361. highlightReverse: true,
  362. inputType: "byteArray",
  363. outputType: "byteArray",
  364. args: [
  365. {
  366. name: "Key",
  367. type: "toggleString",
  368. value: "",
  369. toggleValues: BitwiseOp.KEY_FORMAT
  370. }
  371. ]
  372. },
  373. "OR": {
  374. description: "OR the input with the given key.<br>e.g. <code>fe023da5</code>",
  375. run: BitwiseOp.runOr,
  376. highlight: true,
  377. highlightReverse: true,
  378. inputType: "byteArray",
  379. outputType: "byteArray",
  380. args: [
  381. {
  382. name: "Key",
  383. type: "toggleString",
  384. value: "",
  385. toggleValues: BitwiseOp.KEY_FORMAT
  386. }
  387. ]
  388. },
  389. "ADD": {
  390. description: "ADD the input with the given key (e.g. <code>fe023da5</code>), MOD 255",
  391. run: BitwiseOp.runAdd,
  392. highlight: true,
  393. highlightReverse: true,
  394. inputType: "byteArray",
  395. outputType: "byteArray",
  396. args: [
  397. {
  398. name: "Key",
  399. type: "toggleString",
  400. value: "",
  401. toggleValues: BitwiseOp.KEY_FORMAT
  402. }
  403. ]
  404. },
  405. "SUB": {
  406. description: "SUB the input with the given key (e.g. <code>fe023da5</code>), MOD 255",
  407. run: BitwiseOp.runSub,
  408. highlight: true,
  409. highlightReverse: true,
  410. inputType: "byteArray",
  411. outputType: "byteArray",
  412. args: [
  413. {
  414. name: "Key",
  415. type: "toggleString",
  416. value: "",
  417. toggleValues: BitwiseOp.KEY_FORMAT
  418. }
  419. ]
  420. },
  421. "From Hex": {
  422. description: "Converts a hexadecimal byte string back into a its raw value.<br><br>e.g. <code>ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a</code> becomes the UTF-8 encoded string <code>Γειά σου</code>",
  423. run: ByteRepr.runFromHex,
  424. highlight: ByteRepr.highlightFrom,
  425. highlightReverse: ByteRepr.highlightTo,
  426. inputType: "string",
  427. outputType: "byteArray",
  428. args: [
  429. {
  430. name: "Delimiter",
  431. type: "option",
  432. value: ByteRepr.HEX_DELIM_OPTIONS
  433. }
  434. ]
  435. },
  436. "To Hex": {
  437. description: "Converts the input string to hexadecimal bytes separated by the specified delimiter.<br><br>e.g. The UTF-8 encoded string <code>Γειά σου</code> becomes <code>ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a</code>",
  438. run: ByteRepr.runToHex,
  439. highlight: ByteRepr.highlightTo,
  440. highlightReverse: ByteRepr.highlightFrom,
  441. inputType: "byteArray",
  442. outputType: "string",
  443. args: [
  444. {
  445. name: "Delimiter",
  446. type: "option",
  447. value: ByteRepr.HEX_DELIM_OPTIONS
  448. }
  449. ]
  450. },
  451. "From Charcode": {
  452. description: "Converts unicode character codes back into text.<br><br>e.g. <code>0393 03b5 03b9 03ac 20 03c3 03bf 03c5</code> becomes <code>Γειά σου</code>",
  453. run: ByteRepr.runFromCharcode,
  454. highlight: ByteRepr.highlightFrom,
  455. highlightReverse: ByteRepr.highlightTo,
  456. inputType: "string",
  457. outputType: "byteArray",
  458. args: [
  459. {
  460. name: "Delimiter",
  461. type: "option",
  462. value: ByteRepr.DELIM_OPTIONS
  463. },
  464. {
  465. name: "Base",
  466. type: "number",
  467. value: ByteRepr.CHARCODE_BASE
  468. }
  469. ]
  470. },
  471. "To Charcode": {
  472. description: "Converts text to its unicode character code equivalent.<br><br>e.g. <code>Γειά σου</code> becomes <code>0393 03b5 03b9 03ac 20 03c3 03bf 03c5</code>",
  473. run: ByteRepr.runToCharcode,
  474. highlight: ByteRepr.highlightTo,
  475. highlightReverse: ByteRepr.highlightFrom,
  476. inputType: "string",
  477. outputType: "string",
  478. args: [
  479. {
  480. name: "Delimiter",
  481. type: "option",
  482. value: ByteRepr.DELIM_OPTIONS
  483. },
  484. {
  485. name: "Base",
  486. type: "number",
  487. value: ByteRepr.CHARCODE_BASE
  488. }
  489. ]
  490. },
  491. "From Binary": {
  492. description: "Converts a binary string back into its raw form.<br><br>e.g. <code>01001000 01101001</code> becomes <code>Hi</code>",
  493. run: ByteRepr.runFromBinary,
  494. highlight: ByteRepr.highlightFromBinary,
  495. highlightReverse: ByteRepr.highlightToBinary,
  496. inputType: "string",
  497. outputType: "byteArray",
  498. args: [
  499. {
  500. name: "Delimiter",
  501. type: "option",
  502. value: ByteRepr.BIN_DELIM_OPTIONS
  503. }
  504. ]
  505. },
  506. "To Binary": {
  507. description: "Displays the input data as a binary string.<br><br>e.g. <code>Hi</code> becomes <code>01001000 01101001</code>",
  508. run: ByteRepr.runToBinary,
  509. highlight: ByteRepr.highlightToBinary,
  510. highlightReverse: ByteRepr.highlightFromBinary,
  511. inputType: "byteArray",
  512. outputType: "string",
  513. args: [
  514. {
  515. name: "Delimiter",
  516. type: "option",
  517. value: ByteRepr.BIN_DELIM_OPTIONS
  518. }
  519. ]
  520. },
  521. "From Decimal": {
  522. description: "Converts the data from an ordinal integer array back into its raw form.<br><br>e.g. <code>72 101 108 108 111</code> becomes <code>Hello</code>",
  523. run: ByteRepr.runFromDecimal,
  524. inputType: "string",
  525. outputType: "byteArray",
  526. args: [
  527. {
  528. name: "Delimiter",
  529. type: "option",
  530. value: ByteRepr.DELIM_OPTIONS
  531. }
  532. ]
  533. },
  534. "To Decimal": {
  535. description: "Converts the input data to an ordinal integer array.<br><br>e.g. <code>Hello</code> becomes <code>72 101 108 108 111</code>",
  536. run: ByteRepr.runToDecimal,
  537. inputType: "byteArray",
  538. outputType: "string",
  539. args: [
  540. {
  541. name: "Delimiter",
  542. type: "option",
  543. value: ByteRepr.DELIM_OPTIONS
  544. }
  545. ]
  546. },
  547. "From Hexdump": {
  548. description: "Attempts to convert a hexdump back into raw data. This operation supports many different hexdump variations, but probably not all. Make sure you verify that the data it gives you is correct before continuing analysis.",
  549. run: Hexdump.runFrom,
  550. highlight: Hexdump.highlightFrom,
  551. highlightReverse: Hexdump.highlightTo,
  552. inputType: "string",
  553. outputType: "byteArray",
  554. args: []
  555. },
  556. "To Hexdump": {
  557. description: "Creates a hexdump of the input data, displaying both the hexademinal values of each byte and an ASCII representation alongside.",
  558. run: Hexdump.runTo,
  559. highlight: Hexdump.highlightTo,
  560. highlightReverse: Hexdump.highlightFrom,
  561. inputType: "byteArray",
  562. outputType: "string",
  563. args: [
  564. {
  565. name: "Width",
  566. type: "number",
  567. value: Hexdump.WIDTH
  568. },
  569. {
  570. name: "Upper case hex",
  571. type: "boolean",
  572. value: Hexdump.UPPER_CASE
  573. },
  574. {
  575. name: "Include final length",
  576. type: "boolean",
  577. value: Hexdump.INCLUDE_FINAL_LENGTH
  578. }
  579. ]
  580. },
  581. "From Base": {
  582. description: "Converts a number to decimal from a given numerical base.",
  583. run: Base.runFrom,
  584. inputType: "string",
  585. outputType: "number",
  586. args: [
  587. {
  588. name: "Radix",
  589. type: "number",
  590. value: Base.DEFAULT_RADIX
  591. }
  592. ]
  593. },
  594. "To Base": {
  595. description: "Converts a decimal number to a given numerical base.",
  596. run: Base.runTo,
  597. inputType: "number",
  598. outputType: "string",
  599. args: [
  600. {
  601. name: "Radix",
  602. type: "number",
  603. value: Base.DEFAULT_RADIX
  604. }
  605. ]
  606. },
  607. "From HTML Entity": {
  608. description: "Converts HTML entities back to characters<br><br>e.g. <code>&amp;<span>amp;</span></code> becomes <code>&amp;</code>", // <span> tags required to stop the browser just printing &
  609. run: HTML.runFromEntity,
  610. inputType: "string",
  611. outputType: "string",
  612. args: []
  613. },
  614. "To HTML Entity": {
  615. description: "Converts characters to HTML entities<br><br>e.g. <code>&amp;</code> becomes <code>&amp;<span>amp;</span></code>", // <span> tags required to stop the browser just printing &
  616. run: HTML.runToEntity,
  617. inputType: "string",
  618. outputType: "string",
  619. args: [
  620. {
  621. name: "Convert all characters",
  622. type: "boolean",
  623. value: HTML.CONVERT_ALL
  624. },
  625. {
  626. name: "Convert to",
  627. type: "option",
  628. value: HTML.CONVERT_OPTIONS
  629. }
  630. ]
  631. },
  632. "Strip HTML tags": {
  633. description: "Removes all HTML tags from the input.",
  634. run: HTML.runStripTags,
  635. inputType: "string",
  636. outputType: "string",
  637. args: [
  638. {
  639. name: "Remove indentation",
  640. type: "boolean",
  641. value: HTML.REMOVE_INDENTATION
  642. },
  643. {
  644. name: "Remove excess line breaks",
  645. type: "boolean",
  646. value: HTML.REMOVE_LINE_BREAKS
  647. }
  648. ]
  649. },
  650. "URL Decode": {
  651. description: "Converts URI/URL percent-encoded characters back to their raw values.<br><br>e.g. <code>%3d</code> becomes <code>=</code>",
  652. run: URL_.runFrom,
  653. inputType: "string",
  654. outputType: "string",
  655. args: []
  656. },
  657. "URL Encode": {
  658. description: "Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.<br><br>e.g. <code>=</code> becomes <code>%3d</code>",
  659. run: URL_.runTo,
  660. inputType: "string",
  661. outputType: "string",
  662. args: [
  663. {
  664. name: "Encode all special chars",
  665. type: "boolean",
  666. value: URL_.ENCODE_ALL
  667. }
  668. ]
  669. },
  670. "Parse URI": {
  671. description: "Pretty prints complicated Uniform Resource Identifier (URI) strings for ease of reading. Particularly useful for Uniform Resource Locators (URLs) with a lot of arguments.",
  672. run: URL_.runParse,
  673. inputType: "string",
  674. outputType: "string",
  675. args: []
  676. },
  677. "Unescape Unicode Characters": {
  678. description: "Converts unicode-escaped character notation back into raw characters.<br><br>Supports the prefixes:<ul><li><code>\\u</code></li><li><code>%u</code></li><li><code>U+</code></li></ul>e.g. <code>\\u03c3\\u03bf\\u03c5</code> becomes <code>σου</code>",
  679. run: Unicode.runUnescape,
  680. inputType: "string",
  681. outputType: "string",
  682. args: [
  683. {
  684. name: "Prefix",
  685. type: "option",
  686. value: Unicode.PREFIXES
  687. }
  688. ]
  689. },
  690. "From Quoted Printable": {
  691. description: "Converts QP-encoded text back to standard text.",
  692. run: QuotedPrintable.runFrom,
  693. inputType: "string",
  694. outputType: "byteArray",
  695. args: []
  696. },
  697. "To Quoted Printable": {
  698. description: "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.<br><br>QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.",
  699. run: QuotedPrintable.runTo,
  700. inputType: "byteArray",
  701. outputType: "string",
  702. args: []
  703. },
  704. "From Punycode": {
  705. description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.<br><br>e.g. <code>mnchen-3ya</code> decodes to <code>münchen</code>",
  706. run: Punycode.runToUnicode,
  707. inputType: "string",
  708. outputType: "string",
  709. args: [
  710. {
  711. name: "Internationalised domain name",
  712. type: "boolean",
  713. value: Punycode.IDN
  714. }
  715. ]
  716. },
  717. "To Punycode": {
  718. description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.<br><br>e.g. <code>münchen</code> encodes to <code>mnchen-3ya</code>",
  719. run: Punycode.runToAscii,
  720. inputType: "string",
  721. outputType: "string",
  722. args: [
  723. {
  724. name: "Internationalised domain name",
  725. type: "boolean",
  726. value: Punycode.IDN
  727. }
  728. ]
  729. },
  730. "From Hex Content": {
  731. description: "Translates hexadecimal bytes in text back to raw bytes.<br><br>e.g. <code>foo|3d|bar</code> becomes <code>foo=bar</code>.",
  732. run: ByteRepr.runFromHexContent,
  733. inputType: "string",
  734. outputType: "byteArray",
  735. args: []
  736. },
  737. "To Hex Content": {
  738. description: "Converts special characters in a string to hexadecimal.<br><br>e.g. <code>foo=bar</code> becomes <code>foo|3d|bar</code>.",
  739. run: ByteRepr.runToHexContent,
  740. inputType: "byteArray",
  741. outputType: "string",
  742. args: [
  743. {
  744. name: "Convert",
  745. type: "option",
  746. value: ByteRepr.HEX_CONTENT_CONVERT_WHICH
  747. },
  748. {
  749. name: "Print spaces between bytes",
  750. type: "boolean",
  751. value: ByteRepr.HEX_CONTENT_SPACES_BETWEEN_BYTES
  752. },
  753. ]
  754. },
  755. "Change IP format": {
  756. description: "Convert an IP address from one format to another, e.g. <code>172.20.23.54</code> to <code>ac141736</code>",
  757. run: IP.runChangeIpFormat,
  758. inputType: "string",
  759. outputType: "string",
  760. args: [
  761. {
  762. name: "Input format",
  763. type: "option",
  764. value: IP.IP_FORMAT_LIST
  765. },
  766. {
  767. name: "Output format",
  768. type: "option",
  769. value: IP.IP_FORMAT_LIST
  770. }
  771. ]
  772. },
  773. "Parse IP range": {
  774. description: "Given a CIDR range (e.g. <code>10.0.0.0/24</code>) or a hyphenated range (e.g. <code>10.0.0.0 - 10.0.1.0</code>), this operation provides network information and enumerates all IP addresses in the range.<br><br>IPv6 is supported but will not be enumerated.",
  775. run: IP.runParseIpRange,
  776. inputType: "string",
  777. outputType: "string",
  778. args: [
  779. {
  780. name: "Include network info",
  781. type: "boolean",
  782. value: IP.INCLUDE_NETWORK_INFO
  783. },
  784. {
  785. name: "Enumerate IP addresses",
  786. type: "boolean",
  787. value: IP.ENUMERATE_ADDRESSES
  788. },
  789. {
  790. name: "Allow large queries",
  791. type: "boolean",
  792. value: IP.ALLOW_LARGE_LIST
  793. }
  794. ]
  795. },
  796. "Group IP addresses": {
  797. description: "Groups a list of IP addresses into subnets. Supports both IPv4 and IPv6 addresses.",
  798. run: IP.runGroupIps,
  799. inputType: "string",
  800. outputType: "string",
  801. args: [
  802. {
  803. name: "Delimiter",
  804. type: "option",
  805. value: IP.DELIM_OPTIONS
  806. },
  807. {
  808. name: "Subnet (CIDR)",
  809. type: "number",
  810. value: IP.GROUP_CIDR
  811. },
  812. {
  813. name: "Only show the subnets",
  814. type: "boolean",
  815. value: IP.GROUP_ONLY_SUBNET
  816. }
  817. ]
  818. },
  819. "Parse IPv6 address": {
  820. description: "Displays the longhand and shorthand versions of a valid IPv6 address.<br><br>Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.",
  821. run: IP.runParseIPv6,
  822. inputType: "string",
  823. outputType: "string",
  824. args: []
  825. },
  826. "Parse IPv4 header": {
  827. description: "Given an IPv4 header, this operations parses and displays each field in an easily readable format.",
  828. run: IP.runParseIPv4Header,
  829. inputType: "string",
  830. outputType: "html",
  831. args: [
  832. {
  833. name: "Input format",
  834. type: "option",
  835. value: IP.IP_HEADER_FORMAT
  836. }
  837. ]
  838. },
  839. "Text encoding": {
  840. description: "Translates the data between different character encodings.<br><br>Supported charsets are:<ul><li>UTF8</li><li>UTF16</li><li>UTF16LE (little-endian)</li><li>UTF16BE (big-endian)</li><li>Hex</li><li>Base64</li><li>Latin1 (ISO-8859-1)</li><li>Windows-1251</li></ul>",
  841. run: CharEnc.run,
  842. inputType: "string",
  843. outputType: "string",
  844. args: [
  845. {
  846. name: "Input type",
  847. type: "option",
  848. value: CharEnc.IO_FORMAT
  849. },
  850. {
  851. name: "Output type",
  852. type: "option",
  853. value: CharEnc.IO_FORMAT
  854. },
  855. ]
  856. },
  857. "AES Decrypt": {
  858. description: "To successfully decrypt AES, you need either:<ul><li>The passphrase</li><li>Or the key and IV</li></ul>The IV should be the first 16 bytes of encrypted material.",
  859. run: Cipher.runAesDec,
  860. inputType: "string",
  861. outputType: "string",
  862. args: [
  863. {
  864. name: "Passphrase/Key",
  865. type: "toggleString",
  866. value: "",
  867. toggleValues: Cipher.IO_FORMAT2
  868. },
  869. {
  870. name: "IV",
  871. type: "toggleString",
  872. value: "",
  873. toggleValues: Cipher.IO_FORMAT1
  874. },
  875. {
  876. name: "Salt",
  877. type: "toggleString",
  878. value: "",
  879. toggleValues: Cipher.IO_FORMAT1
  880. },
  881. {
  882. name: "Mode",
  883. type: "option",
  884. value: Cipher.MODES
  885. },
  886. {
  887. name: "Padding",
  888. type: "option",
  889. value: Cipher.PADDING
  890. },
  891. {
  892. name: "Input format",
  893. type: "option",
  894. value: Cipher.IO_FORMAT1
  895. },
  896. {
  897. name: "Output format",
  898. type: "option",
  899. value: Cipher.IO_FORMAT2
  900. },
  901. ]
  902. },
  903. "AES Encrypt": {
  904. description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.<br><br>AES-128, AES-192, and AES-256 are supported. The variant will be chosen based on the size of the key passed in. If a passphrase is used, a 256-bit key will be generated.",
  905. run: Cipher.runAesEnc,
  906. inputType: "string",
  907. outputType: "string",
  908. args: [
  909. {
  910. name: "Passphrase/Key",
  911. type: "toggleString",
  912. value: "",
  913. toggleValues: Cipher.IO_FORMAT2
  914. },
  915. {
  916. name: "IV",
  917. type: "toggleString",
  918. value: "",
  919. toggleValues: Cipher.IO_FORMAT1
  920. },
  921. {
  922. name: "Salt",
  923. type: "toggleString",
  924. value: "",
  925. toggleValues: Cipher.IO_FORMAT1
  926. },
  927. {
  928. name: "Mode",
  929. type: "option",
  930. value: Cipher.MODES
  931. },
  932. {
  933. name: "Padding",
  934. type: "option",
  935. value: Cipher.PADDING
  936. },
  937. {
  938. name: "Output result",
  939. type: "option",
  940. value: Cipher.RESULT_TYPE
  941. },
  942. {
  943. name: "Output format",
  944. type: "option",
  945. value: Cipher.IO_FORMAT1
  946. },
  947. ]
  948. },
  949. "DES Decrypt": {
  950. description: "To successfully decrypt DES, you need either:<ul><li>The passphrase</li><li>Or the key and IV</li></ul>The IV should be the first 8 bytes of encrypted material.",
  951. run: Cipher.runDesDec,
  952. inputType: "string",
  953. outputType: "string",
  954. args: [
  955. {
  956. name: "Passphrase/Key",
  957. type: "toggleString",
  958. value: "",
  959. toggleValues: Cipher.IO_FORMAT2
  960. },
  961. {
  962. name: "IV",
  963. type: "toggleString",
  964. value: "",
  965. toggleValues: Cipher.IO_FORMAT1
  966. },
  967. {
  968. name: "Salt",
  969. type: "toggleString",
  970. value: "",
  971. toggleValues: Cipher.IO_FORMAT1
  972. },
  973. {
  974. name: "Mode",
  975. type: "option",
  976. value: Cipher.MODES
  977. },
  978. {
  979. name: "Padding",
  980. type: "option",
  981. value: Cipher.PADDING
  982. },
  983. {
  984. name: "Input format",
  985. type: "option",
  986. value: Cipher.IO_FORMAT1
  987. },
  988. {
  989. name: "Output format",
  990. type: "option",
  991. value: Cipher.IO_FORMAT2
  992. },
  993. ]
  994. },
  995. "DES Encrypt": {
  996. description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.",
  997. run: Cipher.runDesEnc,
  998. inputType: "string",
  999. outputType: "string",
  1000. args: [
  1001. {
  1002. name: "Passphrase/Key",
  1003. type: "toggleString",
  1004. value: "",
  1005. toggleValues: Cipher.IO_FORMAT2
  1006. },
  1007. {
  1008. name: "IV",
  1009. type: "toggleString",
  1010. value: "",
  1011. toggleValues: Cipher.IO_FORMAT1
  1012. },
  1013. {
  1014. name: "Salt",
  1015. type: "toggleString",
  1016. value: "",
  1017. toggleValues: Cipher.IO_FORMAT1
  1018. },
  1019. {
  1020. name: "Mode",
  1021. type: "option",
  1022. value: Cipher.MODES
  1023. },
  1024. {
  1025. name: "Padding",
  1026. type: "option",
  1027. value: Cipher.PADDING
  1028. },
  1029. {
  1030. name: "Output result",
  1031. type: "option",
  1032. value: Cipher.RESULT_TYPE
  1033. },
  1034. {
  1035. name: "Output format",
  1036. type: "option",
  1037. value: Cipher.IO_FORMAT1
  1038. },
  1039. ]
  1040. },
  1041. "Triple DES Decrypt": {
  1042. description: "To successfully decrypt Triple DES, you need either:<ul><li>The passphrase</li><li>Or the key and IV</li></ul>The IV should be the first 8 bytes of encrypted material.",
  1043. run: Cipher.runTripleDesDec,
  1044. inputType: "string",
  1045. outputType: "string",
  1046. args: [
  1047. {
  1048. name: "Passphrase/Key",
  1049. type: "toggleString",
  1050. value: "",
  1051. toggleValues: Cipher.IO_FORMAT2
  1052. },
  1053. {
  1054. name: "IV",
  1055. type: "toggleString",
  1056. value: "",
  1057. toggleValues: Cipher.IO_FORMAT1
  1058. },
  1059. {
  1060. name: "Salt",
  1061. type: "toggleString",
  1062. value: "",
  1063. toggleValues: Cipher.IO_FORMAT1
  1064. },
  1065. {
  1066. name: "Mode",
  1067. type: "option",
  1068. value: Cipher.MODES
  1069. },
  1070. {
  1071. name: "Padding",
  1072. type: "option",
  1073. value: Cipher.PADDING
  1074. },
  1075. {
  1076. name: "Input format",
  1077. type: "option",
  1078. value: Cipher.IO_FORMAT1
  1079. },
  1080. {
  1081. name: "Output format",
  1082. type: "option",
  1083. value: Cipher.IO_FORMAT2
  1084. },
  1085. ]
  1086. },
  1087. "Triple DES Encrypt": {
  1088. description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>Triple DES applies DES three times to each block to increase key size.",
  1089. run: Cipher.runTripleDesEnc,
  1090. inputType: "string",
  1091. outputType: "string",
  1092. args: [
  1093. {
  1094. name: "Passphrase/Key",
  1095. type: "toggleString",
  1096. value: "",
  1097. toggleValues: Cipher.IO_FORMAT2
  1098. },
  1099. {
  1100. name: "IV",
  1101. type: "toggleString",
  1102. value: "",
  1103. toggleValues: Cipher.IO_FORMAT1
  1104. },
  1105. {
  1106. name: "Salt",
  1107. type: "toggleString",
  1108. value: "",
  1109. toggleValues: Cipher.IO_FORMAT1
  1110. },
  1111. {
  1112. name: "Mode",
  1113. type: "option",
  1114. value: Cipher.MODES
  1115. },
  1116. {
  1117. name: "Padding",
  1118. type: "option",
  1119. value: Cipher.PADDING
  1120. },
  1121. {
  1122. name: "Output result",
  1123. type: "option",
  1124. value: Cipher.RESULT_TYPE
  1125. },
  1126. {
  1127. name: "Output format",
  1128. type: "option",
  1129. value: Cipher.IO_FORMAT1
  1130. },
  1131. ]
  1132. },
  1133. "Blowfish Decrypt": {
  1134. description: "Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.",
  1135. run: Cipher.runBlowfishDec,
  1136. inputType: "string",
  1137. outputType: "string",
  1138. args: [
  1139. {
  1140. name: "Key",
  1141. type: "toggleString",
  1142. value: "",
  1143. toggleValues: Cipher.IO_FORMAT2
  1144. },
  1145. {
  1146. name: "Mode",
  1147. type: "option",
  1148. value: Cipher.BLOWFISH_MODES
  1149. },
  1150. {
  1151. name: "Input format",
  1152. type: "option",
  1153. value: Cipher.IO_FORMAT3
  1154. },
  1155. ]
  1156. },
  1157. "Blowfish Encrypt": {
  1158. description: "Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.",
  1159. run: Cipher.runBlowfishEnc,
  1160. inputType: "string",
  1161. outputType: "string",
  1162. args: [
  1163. {
  1164. name: "Key",
  1165. type: "toggleString",
  1166. value: "",
  1167. toggleValues: Cipher.IO_FORMAT2
  1168. },
  1169. {
  1170. name: "Mode",
  1171. type: "option",
  1172. value: Cipher.BLOWFISH_MODES
  1173. },
  1174. {
  1175. name: "Output format",
  1176. type: "option",
  1177. value: Cipher.IO_FORMAT3
  1178. },
  1179. ]
  1180. },
  1181. "Rabbit Decrypt": {
  1182. description: "To successfully decrypt Rabbit, you need either:<ul><li>The passphrase</li><li>Or the key and IV (This is currently broken. You need the key and salt at the moment.)</li></ul>The IV should be the first 8 bytes of encrypted material.",
  1183. run: Cipher.runRabbitDec,
  1184. inputType: "string",
  1185. outputType: "string",
  1186. args: [
  1187. {
  1188. name: "Passphrase/Key",
  1189. type: "toggleString",
  1190. value: "",
  1191. toggleValues: Cipher.IO_FORMAT2
  1192. },
  1193. {
  1194. name: "IV",
  1195. type: "toggleString",
  1196. value: "",
  1197. toggleValues: Cipher.IO_FORMAT1
  1198. },
  1199. {
  1200. name: "Salt",
  1201. type: "toggleString",
  1202. value: "",
  1203. toggleValues: Cipher.IO_FORMAT1
  1204. },
  1205. {
  1206. name: "Mode",
  1207. type: "option",
  1208. value: Cipher.MODES
  1209. },
  1210. {
  1211. name: "Padding",
  1212. type: "option",
  1213. value: Cipher.PADDING
  1214. },
  1215. {
  1216. name: "Input format",
  1217. type: "option",
  1218. value: Cipher.IO_FORMAT1
  1219. },
  1220. {
  1221. name: "Output format",
  1222. type: "option",
  1223. value: Cipher.IO_FORMAT2
  1224. },
  1225. ]
  1226. },
  1227. "Rabbit Encrypt": {
  1228. description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2 year process where 22 designs were evaluated.",
  1229. run: Cipher.runRabbitEnc,
  1230. inputType: "string",
  1231. outputType: "string",
  1232. args: [
  1233. {
  1234. name: "Passphrase/Key",
  1235. type: "toggleString",
  1236. value: "",
  1237. toggleValues: Cipher.IO_FORMAT2
  1238. },
  1239. {
  1240. name: "IV",
  1241. type: "toggleString",
  1242. value: "",
  1243. toggleValues: Cipher.IO_FORMAT1
  1244. },
  1245. {
  1246. name: "Salt",
  1247. type: "toggleString",
  1248. value: "",
  1249. toggleValues: Cipher.IO_FORMAT1
  1250. },
  1251. {
  1252. name: "Mode",
  1253. type: "option",
  1254. value: Cipher.MODES
  1255. },
  1256. {
  1257. name: "Padding",
  1258. type: "option",
  1259. value: Cipher.PADDING
  1260. },
  1261. {
  1262. name: "Output result",
  1263. type: "option",
  1264. value: Cipher.RESULT_TYPE
  1265. },
  1266. {
  1267. name: "Output format",
  1268. type: "option",
  1269. value: Cipher.IO_FORMAT1
  1270. },
  1271. ]
  1272. },
  1273. "RC4": {
  1274. description: "RC4 is a widely-used stream cipher. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.",
  1275. run: Cipher.runRc4,
  1276. highlight: true,
  1277. highlightReverse: true,
  1278. inputType: "string",
  1279. outputType: "string",
  1280. args: [
  1281. {
  1282. name: "Passphrase",
  1283. type: "toggleString",
  1284. value: "",
  1285. toggleValues: Cipher.IO_FORMAT2
  1286. },
  1287. {
  1288. name: "Input format",
  1289. type: "option",
  1290. value: Cipher.IO_FORMAT4
  1291. },
  1292. {
  1293. name: "Output format",
  1294. type: "option",
  1295. value: Cipher.IO_FORMAT4
  1296. },
  1297. ]
  1298. },
  1299. "RC4 Drop": {
  1300. description: "It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.",
  1301. run: Cipher.runRc4drop,
  1302. highlight: true,
  1303. highlightReverse: true,
  1304. inputType: "string",
  1305. outputType: "string",
  1306. args: [
  1307. {
  1308. name: "Passphrase",
  1309. type: "toggleString",
  1310. value: "",
  1311. toggleValues: Cipher.IO_FORMAT2
  1312. },
  1313. {
  1314. name: "Input format",
  1315. type: "option",
  1316. value: Cipher.IO_FORMAT4
  1317. },
  1318. {
  1319. name: "Output format",
  1320. type: "option",
  1321. value: Cipher.IO_FORMAT4
  1322. },
  1323. {
  1324. name: "Number of bytes to drop",
  1325. type: "number",
  1326. value: Cipher.RC4DROP_BYTES
  1327. },
  1328. ]
  1329. },
  1330. "Derive PBKDF2 key": {
  1331. description: "PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>Enter your passphrase as the input and then set the relevant options to generate a key.",
  1332. run: Cipher.runPbkdf2,
  1333. inputType: "string",
  1334. outputType: "string",
  1335. args: [
  1336. {
  1337. name: "Key size",
  1338. type: "number",
  1339. value: Cipher.KDF_KEY_SIZE
  1340. },
  1341. {
  1342. name: "Iterations",
  1343. type: "number",
  1344. value: Cipher.KDF_ITERATIONS
  1345. },
  1346. {
  1347. name: "Salt (hex)",
  1348. type: "string",
  1349. value: ""
  1350. },
  1351. {
  1352. name: "Input format",
  1353. type: "option",
  1354. value: Cipher.IO_FORMAT2
  1355. },
  1356. {
  1357. name: "Output format",
  1358. type: "option",
  1359. value: Cipher.IO_FORMAT3
  1360. },
  1361. ]
  1362. },
  1363. "Derive EVP key": {
  1364. description: "EVP is a password-based key derivation function used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>Enter your passphrase as the input and then set the relevant options to generate a key.",
  1365. run: Cipher.runEvpkdf,
  1366. inputType: "string",
  1367. outputType: "string",
  1368. args: [
  1369. {
  1370. name: "Key size",
  1371. type: "number",
  1372. value: Cipher.KDF_KEY_SIZE
  1373. },
  1374. {
  1375. name: "Iterations",
  1376. type: "number",
  1377. value: Cipher.KDF_ITERATIONS
  1378. },
  1379. {
  1380. name: "Salt (hex)",
  1381. type: "string",
  1382. value: ""
  1383. },
  1384. {
  1385. name: "Input format",
  1386. type: "option",
  1387. value: Cipher.IO_FORMAT2
  1388. },
  1389. {
  1390. name: "Output format",
  1391. type: "option",
  1392. value: Cipher.IO_FORMAT3
  1393. },
  1394. ]
  1395. },
  1396. "Vigenère Encode": {
  1397. description: "The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",
  1398. run: Cipher.runVigenereEnc,
  1399. highlight: true,
  1400. highlightReverse: true,
  1401. inputType: "string",
  1402. outputType: "string",
  1403. args: [
  1404. {
  1405. name: "Key",
  1406. type: "string",
  1407. value: ""
  1408. }
  1409. ]
  1410. },
  1411. "Vigenère Decode": {
  1412. description: "The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",
  1413. run: Cipher.runVigenereDec,
  1414. highlight: true,
  1415. highlightReverse: true,
  1416. inputType: "string",
  1417. outputType: "string",
  1418. args: [
  1419. {
  1420. name: "Key",
  1421. type: "string",
  1422. value: ""
  1423. }
  1424. ]
  1425. },
  1426. "Affine Cipher Encode": {
  1427. description: "The Affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using simple mathematical function, <code>(ax + b) % 26</code>, and converted back to a letter.",
  1428. run: Cipher.runAffineEnc,
  1429. highlight: true,
  1430. highlightReverse: true,
  1431. inputType: "string",
  1432. outputType: "string",
  1433. args: [
  1434. {
  1435. name: "a",
  1436. type: "number",
  1437. value: Cipher.AFFINE_A
  1438. },
  1439. {
  1440. name: "b",
  1441. type: "number",
  1442. value: Cipher.AFFINE_B
  1443. }
  1444. ]
  1445. },
  1446. "Affine Cipher Decode": {
  1447. description: "The Affine cipher is a type of monoalphabetic substitution cipher. To decrypt, each letter in an alphabet is mapped to its numeric equivalent, decrypted by a mathematical function, and converted back to a letter.",
  1448. run: Cipher.runAffineDec,
  1449. highlight: true,
  1450. highlightReverse: true,
  1451. inputType: "string",
  1452. outputType: "string",
  1453. args: [
  1454. {
  1455. name: "a",
  1456. type: "number",
  1457. value: Cipher.AFFINE_A
  1458. },
  1459. {
  1460. name: "b",
  1461. type: "number",
  1462. value: Cipher.AFFINE_B
  1463. }
  1464. ]
  1465. },
  1466. "Atbash Cipher": {
  1467. description: "Atbash is a mono-alphabetic substitution cipher originally used to encode the Hebrew alphabet. It has been modified here for use with the Latin alphabet.",
  1468. run: Cipher.runAtbash,
  1469. highlight: true,
  1470. highlightReverse: true,
  1471. inputType: "string",
  1472. outputType: "string",
  1473. args: []
  1474. },
  1475. "Rotate right": {
  1476. description: "Rotates each byte to the right by the number of bits specified. Currently only supports 8-bit values.",
  1477. run: Rotate.runRotr,
  1478. highlight: true,
  1479. highlightReverse: true,
  1480. inputType: "byteArray",
  1481. outputType: "byteArray",
  1482. args: [
  1483. {
  1484. name: "Number of bits",
  1485. type: "number",
  1486. value: Rotate.ROTATE_AMOUNT
  1487. },
  1488. {
  1489. name: "Rotate as a whole",
  1490. type: "boolean",
  1491. value: Rotate.ROTATE_WHOLE
  1492. }
  1493. ]
  1494. },
  1495. "Rotate left": {
  1496. description: "Rotates each byte to the left by the number of bits specified. Currently only supports 8-bit values.",
  1497. run: Rotate.runRotl,
  1498. highlight: true,
  1499. highlightReverse: true,
  1500. inputType: "byteArray",
  1501. outputType: "byteArray",
  1502. args: [
  1503. {
  1504. name: "Number of bits",
  1505. type: "number",
  1506. value: Rotate.ROTATE_AMOUNT
  1507. },
  1508. {
  1509. name: "Rotate as a whole",
  1510. type: "boolean",
  1511. value: Rotate.ROTATE_WHOLE
  1512. }
  1513. ]
  1514. },
  1515. "ROT13": {
  1516. description: "A simple caesar substitution cipher which rotates alphabet characters by the specified amount (default 13).",
  1517. run: Rotate.runRot13,
  1518. highlight: true,
  1519. highlightReverse: true,
  1520. inputType: "byteArray",
  1521. outputType: "byteArray",
  1522. args: [
  1523. {
  1524. name: "Rotate lower case chars",
  1525. type: "boolean",
  1526. value: Rotate.ROT13_LOWERCASE
  1527. },
  1528. {
  1529. name: "Rotate upper case chars",
  1530. type: "boolean",
  1531. value: Rotate.ROT13_UPPERCASE
  1532. },
  1533. {
  1534. name: "Amount",
  1535. type: "number",
  1536. value: Rotate.ROT13_AMOUNT
  1537. },
  1538. ]
  1539. },
  1540. "ROT47": {
  1541. description: "A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",
  1542. run: Rotate.runRot47,
  1543. highlight: true,
  1544. highlightReverse: true,
  1545. inputType: "byteArray",
  1546. outputType: "byteArray",
  1547. args: [
  1548. {
  1549. name: "Amount",
  1550. type: "number",
  1551. value: Rotate.ROT47_AMOUNT
  1552. },
  1553. ]
  1554. },
  1555. "Strip HTTP headers": {
  1556. description: "Removes HTTP headers from a request or response by looking for the first instance of a double newline.",
  1557. run: HTTP.runStripHeaders,
  1558. inputType: "string",
  1559. outputType: "string",
  1560. args: []
  1561. },
  1562. "Parse User Agent": {
  1563. description: "Attempts to identify and categorise information contained in a user-agent string.",
  1564. run: HTTP.runParseUserAgent,
  1565. inputType: "string",
  1566. outputType: "string",
  1567. args: []
  1568. },
  1569. "Format MAC addresses": {
  1570. description: "Displays given MAC addresses in multiple different formats.<br><br>Expects addresses in a list separated by newlines, spaces or commas.<br><br>WARNING: There are no validity checks.",
  1571. run: MAC.runFormat,
  1572. inputType: "string",
  1573. outputType: "string",
  1574. args: [
  1575. {
  1576. name: "Output case",
  1577. type: "option",
  1578. value: MAC.OUTPUT_CASE
  1579. },
  1580. {
  1581. name: "No delimiter",
  1582. type: "boolean",
  1583. value: MAC.NO_DELIM
  1584. },
  1585. {
  1586. name: "Dash delimiter",
  1587. type: "boolean",
  1588. value: MAC.DASH_DELIM
  1589. },
  1590. {
  1591. name: "Colon delimiter",
  1592. type: "boolean",
  1593. value: MAC.COLON_DELIM
  1594. },
  1595. {
  1596. name: "Cisco style",
  1597. type: "boolean",
  1598. value: MAC.CISCO_STYLE
  1599. }
  1600. ]
  1601. },
  1602. "Encode NetBIOS Name": {
  1603. description: "NetBIOS names as seen across the client interface to NetBIOS are exactly 16 bytes long. Within the NetBIOS-over-TCP protocols, a longer representation is used.<br><br>There are two levels of encoding. The first level maps a NetBIOS name into a domain system name. The second level maps the domain system name into the 'compressed' representation required for interaction with the domain name system.<br><br>This operation carries out the first level of encoding. See RFC 1001 for full details.",
  1604. run: NetBIOS.runEncodeName,
  1605. inputType: "byteArray",
  1606. outputType: "byteArray",
  1607. args: [
  1608. {
  1609. name: "Offset",
  1610. type: "number",
  1611. value: NetBIOS.OFFSET
  1612. }
  1613. ]
  1614. },
  1615. "Decode NetBIOS Name": {
  1616. description: "NetBIOS names as seen across the client interface to NetBIOS are exactly 16 bytes long. Within the NetBIOS-over-TCP protocols, a longer representation is used.<br><br>There are two levels of encoding. The first level maps a NetBIOS name into a domain system name. The second level maps the domain system name into the 'compressed' representation required for interaction with the domain name system.<br><br>This operation decodes the first level of encoding. See RFC 1001 for full details.",
  1617. run: NetBIOS.runDecodeName,
  1618. inputType: "byteArray",
  1619. outputType: "byteArray",
  1620. args: [
  1621. {
  1622. name: "Offset",
  1623. type: "number",
  1624. value: NetBIOS.OFFSET
  1625. }
  1626. ]
  1627. },
  1628. "Offset checker": {
  1629. description: "Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.",
  1630. run: StrUtils.runOffsetChecker,
  1631. inputType: "string",
  1632. outputType: "html",
  1633. args: [
  1634. {
  1635. name: "Sample delimiter",
  1636. type: "binaryString",
  1637. value: StrUtils.OFF_CHK_SAMPLE_DELIMITER
  1638. }
  1639. ]
  1640. },
  1641. "Remove whitespace": {
  1642. description: "Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.<br><br>This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.",
  1643. run: Tidy.runRemoveWhitespace,
  1644. inputType: "string",
  1645. outputType: "string",
  1646. args: [
  1647. {
  1648. name: "Spaces",
  1649. type: "boolean",
  1650. value: Tidy.REMOVE_SPACES
  1651. },
  1652. {
  1653. name: "Carriage returns (\\r)",
  1654. type: "boolean",
  1655. value: Tidy.REMOVE_CARIAGE_RETURNS
  1656. },
  1657. {
  1658. name: "Line feeds (\\n)",
  1659. type: "boolean",
  1660. value: Tidy.REMOVE_LINE_FEEDS
  1661. },
  1662. {
  1663. name: "Tabs",
  1664. type: "boolean",
  1665. value: Tidy.REMOVE_TABS
  1666. },
  1667. {
  1668. name: "Form feeds (\\f)",
  1669. type: "boolean",
  1670. value: Tidy.REMOVE_FORM_FEEDS
  1671. },
  1672. {
  1673. name: "Full stops",
  1674. type: "boolean",
  1675. value: Tidy.REMOVE_FULL_STOPS
  1676. }
  1677. ]
  1678. },
  1679. "Remove null bytes": {
  1680. description: "Removes all null bytes (<code>0x00</code>) from the input.",
  1681. run: Tidy.runRemoveNulls,
  1682. inputType: "byteArray",
  1683. outputType: "byteArray",
  1684. args: []
  1685. },
  1686. "Drop bytes": {
  1687. description: "Cuts the specified number of bytes out of the data.",
  1688. run: Tidy.runDropBytes,
  1689. inputType: "byteArray",
  1690. outputType: "byteArray",
  1691. args: [
  1692. {
  1693. name: "Start",
  1694. type: "number",
  1695. value: Tidy.DROP_START
  1696. },
  1697. {
  1698. name: "Length",
  1699. type: "number",
  1700. value: Tidy.DROP_LENGTH
  1701. },
  1702. {
  1703. name: "Apply to each line",
  1704. type: "boolean",
  1705. value: Tidy.APPLY_TO_EACH_LINE
  1706. }
  1707. ]
  1708. },
  1709. "Take bytes": {
  1710. description: "Takes a slice of the specified number of bytes from the data.",
  1711. run: Tidy.runTakeBytes,
  1712. inputType: "byteArray",
  1713. outputType: "byteArray",
  1714. args: [
  1715. {
  1716. name: "Start",
  1717. type: "number",
  1718. value: Tidy.TAKE_START
  1719. },
  1720. {
  1721. name: "Length",
  1722. type: "number",
  1723. value: Tidy.TAKE_LENGTH
  1724. },
  1725. {
  1726. name: "Apply to each line",
  1727. type: "boolean",
  1728. value: Tidy.APPLY_TO_EACH_LINE
  1729. }
  1730. ]
  1731. },
  1732. "Pad lines": {
  1733. description: "Add the specified number of the specified character to the beginning or end of each line",
  1734. run: Tidy.runPad,
  1735. inputType: "string",
  1736. outputType: "string",
  1737. args: [
  1738. {
  1739. name: "Position",
  1740. type: "option",
  1741. value: Tidy.PAD_POSITION
  1742. },
  1743. {
  1744. name: "Length",
  1745. type: "number",
  1746. value: Tidy.PAD_LENGTH
  1747. },
  1748. {
  1749. name: "Character",
  1750. type: "binaryShortString",
  1751. value: Tidy.PAD_CHAR
  1752. }
  1753. ]
  1754. },
  1755. "Reverse": {
  1756. description: "Reverses the input string.",
  1757. run: SeqUtils.runReverse,
  1758. inputType: "byteArray",
  1759. outputType: "byteArray",
  1760. args: [
  1761. {
  1762. name: "By",
  1763. type: "option",
  1764. value: SeqUtils.REVERSE_BY
  1765. }
  1766. ]
  1767. },
  1768. "Sort": {
  1769. description: "Alphabetically sorts strings separated by the specified delimiter.<br><br>The IP address option supports IPv4 only.",
  1770. run: SeqUtils.runSort,
  1771. inputType: "string",
  1772. outputType: "string",
  1773. args: [
  1774. {
  1775. name: "Delimiter",
  1776. type: "option",
  1777. value: SeqUtils.DELIMITER_OPTIONS
  1778. },
  1779. {
  1780. name: "Reverse",
  1781. type: "boolean",
  1782. value: SeqUtils.SORT_REVERSE
  1783. },
  1784. {
  1785. name: "Order",
  1786. type: "option",
  1787. value: SeqUtils.SORT_ORDER
  1788. }
  1789. ]
  1790. },
  1791. "Unique": {
  1792. description: "Removes duplicate strings from the input.",
  1793. run: SeqUtils.runUnique,
  1794. inputType: "string",
  1795. outputType: "string",
  1796. args: [
  1797. {
  1798. name: "Delimiter",
  1799. type: "option",
  1800. value: SeqUtils.DELIMITER_OPTIONS
  1801. }
  1802. ]
  1803. },
  1804. "Count occurrences": {
  1805. description: "Counts the number of times the provided string occurs in the input.",
  1806. run: SeqUtils.runCount,
  1807. inputType: "string",
  1808. outputType: "number",
  1809. args: [
  1810. {
  1811. name: "Search string",
  1812. type: "toggleString",
  1813. value: "",
  1814. toggleValues: SeqUtils.SEARCH_TYPE
  1815. }
  1816. ]
  1817. },
  1818. "Add line numbers": {
  1819. description: "Adds line numbers to the output.",
  1820. run: SeqUtils.runAddLineNumbers,
  1821. inputType: "string",
  1822. outputType: "string",
  1823. args: []
  1824. },
  1825. "Remove line numbers": {
  1826. description: "Removes line numbers from the output if they can be trivially detected.",
  1827. run: SeqUtils.runRemoveLineNumbers,
  1828. inputType: "string",
  1829. outputType: "string",
  1830. args: []
  1831. },
  1832. "Find / Replace": {
  1833. description: "Replaces all occurrences of the first string with the second.<br><br>The three match options are only relevant to regex search strings.",
  1834. run: StrUtils.runFindReplace,
  1835. manualBake: true,
  1836. inputType: "string",
  1837. outputType: "string",
  1838. args: [
  1839. {
  1840. name: "Find",
  1841. type: "toggleString",
  1842. value: "",
  1843. toggleValues: StrUtils.SEARCH_TYPE
  1844. },
  1845. {
  1846. name: "Replace",
  1847. type: "binaryString",
  1848. value: ""
  1849. },
  1850. {
  1851. name: "Global match",
  1852. type: "boolean",
  1853. value: StrUtils.FIND_REPLACE_GLOBAL,
  1854. },
  1855. {
  1856. name: "Case insensitive",
  1857. type: "boolean",
  1858. value: StrUtils.FIND_REPLACE_CASE,
  1859. },
  1860. {
  1861. name: "Multiline matching",
  1862. type: "boolean",
  1863. value: StrUtils.FIND_REPLACE_MULTILINE,
  1864. },
  1865. ]
  1866. },
  1867. "To Upper case": {
  1868. description: "Converts the input string to upper case, optionally limiting scope to only the first character in each word, sentence or paragraph.",
  1869. run: StrUtils.runUpper,
  1870. highlight: true,
  1871. highlightReverse: true,
  1872. inputType: "string",
  1873. outputType: "string",
  1874. args: [
  1875. {
  1876. name: "Scope",
  1877. type: "option",
  1878. value: StrUtils.CASE_SCOPE
  1879. }
  1880. ]
  1881. },
  1882. "To Lower case": {
  1883. description: "Converts every character in the input to lower case.",
  1884. run: StrUtils.runLower,
  1885. highlight: true,
  1886. highlightReverse: true,
  1887. inputType: "string",
  1888. outputType: "string",
  1889. args: []
  1890. },
  1891. "Split": {
  1892. description: "Splits a string into sections around a given delimiter.",
  1893. run: StrUtils.runSplit,
  1894. inputType: "string",
  1895. outputType: "string",
  1896. args: [
  1897. {
  1898. name: "Split delimiter",
  1899. type: "binaryShortString",
  1900. value: StrUtils.SPLIT_DELIM
  1901. },
  1902. {
  1903. name: "Join delimiter",
  1904. type: "option",
  1905. value: StrUtils.DELIMITER_OPTIONS
  1906. }
  1907. ]
  1908. },
  1909. "Filter": {
  1910. description: "Splits up the input using the specified delimiter and then filters each branch based on a regular expression.",
  1911. run: StrUtils.runFilter,
  1912. manualBake: true,
  1913. inputType: "string",
  1914. outputType: "string",
  1915. args: [
  1916. {
  1917. name: "Delimiter",
  1918. type: "option",
  1919. value: StrUtils.DELIMITER_OPTIONS
  1920. },
  1921. {
  1922. name: "Regex",
  1923. type: "string",
  1924. value: ""
  1925. },
  1926. {
  1927. name: "Invert condition",
  1928. type: "boolean",
  1929. value: SeqUtils.SORT_REVERSE
  1930. },
  1931. ]
  1932. },
  1933. "Strings": {
  1934. description: "Extracts all strings from the input.",
  1935. run: Extract.runStrings,
  1936. inputType: "string",
  1937. outputType: "string",
  1938. args: [
  1939. {
  1940. name: "Minimum length",
  1941. type: "number",
  1942. value: Extract.MIN_STRING_LEN
  1943. },
  1944. {
  1945. name: "Display total",
  1946. type: "boolean",
  1947. value: Extract.DISPLAY_TOTAL
  1948. }
  1949. ]
  1950. },
  1951. "Extract IP addresses": {
  1952. description: "Extracts all IPv4 and IPv6 addresses.<br><br>Warning: Given a string <code>710.65.0.456</code>, this will match <code>10.65.0.45</code> so always check the original input!",
  1953. run: Extract.runIp,
  1954. inputType: "string",
  1955. outputType: "string",
  1956. args: [
  1957. {
  1958. name: "IPv4",
  1959. type: "boolean",
  1960. value: Extract.INCLUDE_IPV4
  1961. },
  1962. {
  1963. name: "IPv6",
  1964. type: "boolean",
  1965. value: Extract.INCLUDE_IPV6
  1966. },
  1967. {
  1968. name: "Remove local IPv4 addresses",
  1969. type: "boolean",
  1970. value: Extract.REMOVE_LOCAL
  1971. },
  1972. {
  1973. name: "Display total",
  1974. type: "boolean",
  1975. value: Extract.DISPLAY_TOTAL
  1976. }
  1977. ]
  1978. },
  1979. "Extract email addresses": {
  1980. description: "Extracts all email addresses from the input.",
  1981. run: Extract.runEmail,
  1982. inputType: "string",
  1983. outputType: "string",
  1984. args: [
  1985. {
  1986. name: "Display total",
  1987. type: "boolean",
  1988. value: Extract.DISPLAY_TOTAL
  1989. }
  1990. ]
  1991. },
  1992. "Extract MAC addresses": {
  1993. description: "Extracts all Media Access Control (MAC) addresses from the input.",
  1994. run: Extract.runMac,
  1995. inputType: "string",
  1996. outputType: "string",
  1997. args: [
  1998. {
  1999. name: "Display total",
  2000. type: "boolean",
  2001. value: Extract.DISPLAY_TOTAL
  2002. }
  2003. ]
  2004. },
  2005. "Extract URLs": {
  2006. description: "Extracts Uniform Resource Locators (URLs) from the input. The protocol (http, ftp etc.) is required otherwise there will be far too many false positives.",
  2007. run: Extract.runUrls,
  2008. inputType: "string",
  2009. outputType: "string",
  2010. args: [
  2011. {
  2012. name: "Display total",
  2013. type: "boolean",
  2014. value: Extract.DISPLAY_TOTAL
  2015. }
  2016. ]
  2017. },
  2018. "Extract domains": {
  2019. description: "Extracts domain names with common Top-Level Domains (TLDs).<br>Note that this will not include paths. Use <strong>Extract URLs</strong> to find entire URLs.",
  2020. run: Extract.runDomains,
  2021. inputType: "string",
  2022. outputType: "string",
  2023. args: [
  2024. {
  2025. name: "Display total",
  2026. type: "boolean",
  2027. value: Extract.DISPLAY_TOTAL
  2028. }
  2029. ]
  2030. },
  2031. "Extract file paths": {
  2032. description: "Extracts anything that looks like a Windows or UNIX file path.<br><br>Note that if UNIX is selected, there will likely be a lot of false positives.",
  2033. run: Extract.runFilePaths,
  2034. inputType: "string",
  2035. outputType: "string",
  2036. args: [
  2037. {
  2038. name: "Windows",
  2039. type: "boolean",
  2040. value: Extract.INCLUDE_WIN_PATH
  2041. },
  2042. {
  2043. name: "UNIX",
  2044. type: "boolean",
  2045. value: Extract.INCLUDE_UNIX_PATH
  2046. },
  2047. {
  2048. name: "Display total",
  2049. type: "boolean",
  2050. value: Extract.DISPLAY_TOTAL
  2051. }
  2052. ]
  2053. },
  2054. "Extract dates": {
  2055. description: "Extracts dates in the following formats<ul><li><code>yyyy-mm-dd</code></li><li><code>dd/mm/yyyy</code></li><li><code>mm/dd/yyyy</code></li></ul>Dividers can be any of /, -, . or space",
  2056. run: Extract.runDates,
  2057. inputType: "string",
  2058. outputType: "string",
  2059. args: [
  2060. {
  2061. name: "Display total",
  2062. type: "boolean",
  2063. value: Extract.DISPLAY_TOTAL
  2064. }
  2065. ]
  2066. },
  2067. "Regular expression": {
  2068. description: "Define your own regular expression (regex) to search the input data with, optionally choosing from a list of pre-defined patterns.",
  2069. run: StrUtils.runRegex,
  2070. manualBake: true,
  2071. inputType: "string",
  2072. outputType: "html",
  2073. args: [
  2074. {
  2075. name: "Built in regexes",
  2076. type: "populateOption",
  2077. value: StrUtils.REGEX_PRE_POPULATE,
  2078. target: 1,
  2079. },
  2080. {
  2081. name: "Regex",
  2082. type: "text",
  2083. value: ""
  2084. },
  2085. {
  2086. name: "Case insensitive",
  2087. type: "boolean",
  2088. value: StrUtils.REGEX_CASE_INSENSITIVE
  2089. },
  2090. {
  2091. name: "Multiline matching",
  2092. type: "boolean",
  2093. value: StrUtils.REGEX_MULTILINE_MATCHING
  2094. },
  2095. {
  2096. name: "Display total",
  2097. type: "boolean",
  2098. value: StrUtils.DISPLAY_TOTAL
  2099. },
  2100. {
  2101. name: "Output format",
  2102. type: "option",
  2103. value: StrUtils.OUTPUT_FORMAT
  2104. },
  2105. ]
  2106. },
  2107. "XPath expression": {
  2108. description: "Extract information from an XML document with an XPath query",
  2109. run: Code.runXpath,
  2110. inputType: "string",
  2111. outputType: "string",
  2112. args: [
  2113. {
  2114. name: "XPath",
  2115. type: "string",
  2116. value: Code.XPATH_INITIAL
  2117. },
  2118. {
  2119. name: "Result delimiter",
  2120. type: "binaryShortString",
  2121. value: Code.XPATH_DELIMITER
  2122. }
  2123. ]
  2124. },
  2125. "CSS selector": {
  2126. description: "Extract information from an HTML document with a CSS selector",
  2127. run: Code.runCSSQuery,
  2128. inputType: "string",
  2129. outputType: "string",
  2130. args: [
  2131. {
  2132. name: "CSS selector",
  2133. type: "string",
  2134. value: Code.CSS_SELECTOR_INITIAL
  2135. },
  2136. {
  2137. name: "Delimiter",
  2138. type: "binaryShortString",
  2139. value: Code.CSS_QUERY_DELIMITER
  2140. },
  2141. ]
  2142. },
  2143. "From UNIX Timestamp": {
  2144. description: "Converts a UNIX timestamp to a datetime string.<br><br>e.g. <code>978346800</code> becomes <code>Mon 1 January 2001 11:00:00 UTC</code>",
  2145. run: DateTime.runFromUnixTimestamp,
  2146. inputType: "number",
  2147. outputType: "string",
  2148. args: [
  2149. {
  2150. name: "Units",
  2151. type: "option",
  2152. value: DateTime.UNITS
  2153. }
  2154. ]
  2155. },
  2156. "To UNIX Timestamp": {
  2157. description: "Parses a datetime string and returns the corresponding UNIX timestamp.<br><br>e.g. <code>Mon 1 January 2001 11:00:00 UTC</code> becomes <code>978346800</code>",
  2158. run: DateTime.runToUnixTimestamp,
  2159. inputType: "string",
  2160. outputType: "number",
  2161. args: [
  2162. {
  2163. name: "Units",
  2164. type: "option",
  2165. value: DateTime.UNITS
  2166. }
  2167. ]
  2168. },
  2169. "Translate DateTime Format": {
  2170. description: "Parses a datetime string in one format and re-writes it in another.<br><br>Run with no input to see the relevant format string examples.",
  2171. run: DateTime.runTranslateFormat,
  2172. inputType: "string",
  2173. outputType: "html",
  2174. args: [
  2175. {
  2176. name: "Built in formats",
  2177. type: "populateOption",
  2178. value: DateTime.DATETIME_FORMATS,
  2179. target: 1
  2180. },
  2181. {
  2182. name: "Input format string",
  2183. type: "binaryString",
  2184. value: DateTime.INPUT_FORMAT_STRING
  2185. },
  2186. {
  2187. name: "Input timezone",
  2188. type: "option",
  2189. value: DateTime.TIMEZONES
  2190. },
  2191. {
  2192. name: "Output format string",
  2193. type: "binaryString",
  2194. value: DateTime.OUTPUT_FORMAT_STRING
  2195. },
  2196. {
  2197. name: "Output timezone",
  2198. type: "option",
  2199. value: DateTime.TIMEZONES
  2200. }
  2201. ]
  2202. },
  2203. "Parse DateTime": {
  2204. description: "Parses a DateTime string in your specified format and displays it in whichever timezone you choose with the following information:<ul><li>Date</li><li>Time</li><li>Period (AM/PM)</li><li>Timezone</li><li>UTC offset</li><li>Daylight Saving Time</li><li>Leap year</li><li>Days in this month</li><li>Day of year</li><li>Week number</li><li>Quarter</li></ul>Run with no input to see format string examples if required.",
  2205. run: DateTime.runParse,
  2206. inputType: "string",
  2207. outputType: "html",
  2208. args: [
  2209. {
  2210. name: "Built in formats",
  2211. type: "populateOption",
  2212. value: DateTime.DATETIME_FORMATS,
  2213. target: 1
  2214. },
  2215. {
  2216. name: "Input format string",
  2217. type: "binaryString",
  2218. value: DateTime.INPUT_FORMAT_STRING
  2219. },
  2220. {
  2221. name: "Input timezone",
  2222. type: "option",
  2223. value: DateTime.TIMEZONES
  2224. },
  2225. ]
  2226. },
  2227. "Convert distance": {
  2228. description: "Converts a unit of distance to another format.",
  2229. run: Convert.runDistance,
  2230. inputType: "number",
  2231. outputType: "number",
  2232. args: [
  2233. {
  2234. name: "Input units",
  2235. type: "option",
  2236. value: Convert.DISTANCE_UNITS
  2237. },
  2238. {
  2239. name: "Output units",
  2240. type: "option",
  2241. value: Convert.DISTANCE_UNITS
  2242. }
  2243. ]
  2244. },
  2245. "Convert area": {
  2246. description: "Converts a unit of area to another format.",
  2247. run: Convert.runArea,
  2248. inputType: "number",
  2249. outputType: "number",
  2250. args: [
  2251. {
  2252. name: "Input units",
  2253. type: "option",
  2254. value: Convert.AREA_UNITS
  2255. },
  2256. {
  2257. name: "Output units",
  2258. type: "option",
  2259. value: Convert.AREA_UNITS
  2260. }
  2261. ]
  2262. },
  2263. "Convert mass": {
  2264. description: "Converts a unit of mass to another format.",
  2265. run: Convert.runMass,
  2266. inputType: "number",
  2267. outputType: "number",
  2268. args: [
  2269. {
  2270. name: "Input units",
  2271. type: "option",
  2272. value: Convert.MASS_UNITS
  2273. },
  2274. {
  2275. name: "Output units",
  2276. type: "option",
  2277. value: Convert.MASS_UNITS
  2278. }
  2279. ]
  2280. },
  2281. "Convert speed": {
  2282. description: "Converts a unit of speed to another format.",
  2283. run: Convert.runSpeed,
  2284. inputType: "number",
  2285. outputType: "number",
  2286. args: [
  2287. {
  2288. name: "Input units",
  2289. type: "option",
  2290. value: Convert.SPEED_UNITS
  2291. },
  2292. {
  2293. name: "Output units",
  2294. type: "option",
  2295. value: Convert.SPEED_UNITS
  2296. }
  2297. ]
  2298. },
  2299. "Convert data units": {
  2300. description: "Converts a unit of data to another format.",
  2301. run: Convert.runDataSize,
  2302. inputType: "number",
  2303. outputType: "number",
  2304. args: [
  2305. {
  2306. name: "Input units",
  2307. type: "option",
  2308. value: Convert.DATA_UNITS
  2309. },
  2310. {
  2311. name: "Output units",
  2312. type: "option",
  2313. value: Convert.DATA_UNITS
  2314. }
  2315. ]
  2316. },
  2317. "Raw Deflate": {
  2318. description: "Compresses data using the deflate algorithm with no headers.",
  2319. run: Compress.runRawDeflate,
  2320. inputType: "byteArray",
  2321. outputType: "byteArray",
  2322. args: [
  2323. {
  2324. name: "Compression type",
  2325. type: "option",
  2326. value: Compress.COMPRESSION_TYPE
  2327. }
  2328. ]
  2329. },
  2330. "Raw Inflate": {
  2331. description: "Decompresses data which has been compressed using the deflate algorithm with no headers.",
  2332. run: Compress.runRawInflate,
  2333. inputType: "byteArray",
  2334. outputType: "byteArray",
  2335. args: [
  2336. {
  2337. name: "Start index",
  2338. type: "number",
  2339. value: Compress.INFLATE_INDEX
  2340. },
  2341. {
  2342. name: "Initial output buffer size",
  2343. type: "number",
  2344. value: Compress.INFLATE_BUFFER_SIZE
  2345. },
  2346. {
  2347. name: "Buffer expansion type",
  2348. type: "option",
  2349. value: Compress.INFLATE_BUFFER_TYPE
  2350. },
  2351. {
  2352. name: "Resize buffer after decompression",
  2353. type: "boolean",
  2354. value: Compress.INFLATE_RESIZE
  2355. },
  2356. {
  2357. name: "Verify result",
  2358. type: "boolean",
  2359. value: Compress.INFLATE_VERIFY
  2360. }
  2361. ]
  2362. },
  2363. "Zlib Deflate": {
  2364. description: "Compresses data using the deflate algorithm adding zlib headers.",
  2365. run: Compress.runZlibDeflate,
  2366. inputType: "byteArray",
  2367. outputType: "byteArray",
  2368. args: [
  2369. {
  2370. name: "Compression type",
  2371. type: "option",
  2372. value: Compress.COMPRESSION_TYPE
  2373. }
  2374. ]
  2375. },
  2376. "Zlib Inflate": {
  2377. description: "Decompresses data which has been compressed using the deflate algorithm with zlib headers.",
  2378. run: Compress.runZlibInflate,
  2379. inputType: "byteArray",
  2380. outputType: "byteArray",
  2381. args: [
  2382. {
  2383. name: "Start index",
  2384. type: "number",
  2385. value: Compress.INFLATE_INDEX
  2386. },
  2387. {
  2388. name: "Initial output buffer size",
  2389. type: "number",
  2390. value: Compress.INFLATE_BUFFER_SIZE
  2391. },
  2392. {
  2393. name: "Buffer expansion type",
  2394. type: "option",
  2395. value: Compress.INFLATE_BUFFER_TYPE
  2396. },
  2397. {
  2398. name: "Resize buffer after decompression",
  2399. type: "boolean",
  2400. value: Compress.INFLATE_RESIZE
  2401. },
  2402. {
  2403. name: "Verify result",
  2404. type: "boolean",
  2405. value: Compress.INFLATE_VERIFY
  2406. }
  2407. ]
  2408. },
  2409. "Gzip": {
  2410. description: "Compresses data using the deflate algorithm with gzip headers.",
  2411. run: Compress.runGzip,
  2412. inputType: "byteArray",
  2413. outputType: "byteArray",
  2414. args: [
  2415. {
  2416. name: "Compression type",
  2417. type: "option",
  2418. value: Compress.COMPRESSION_TYPE
  2419. },
  2420. {
  2421. name: "Filename (optional)",
  2422. type: "string",
  2423. value: ""
  2424. },
  2425. {
  2426. name: "Comment (optional)",
  2427. type: "string",
  2428. value: ""
  2429. },
  2430. {
  2431. name: "Include file checksum",
  2432. type: "boolean",
  2433. value: Compress.GZIP_CHECKSUM
  2434. }
  2435. ]
  2436. },
  2437. "Gunzip": {
  2438. description: "Decompresses data which has been compressed using the deflate algorithm with gzip headers.",
  2439. run: Compress.runGunzip,
  2440. inputType: "byteArray",
  2441. outputType: "byteArray",
  2442. args: []
  2443. },
  2444. "Zip": {
  2445. description: "Compresses data using the PKZIP algorithm with the given filename.<br><br>No support for multiple files at this time.",
  2446. run: Compress.runPkzip,
  2447. inputType: "byteArray",
  2448. outputType: "byteArray",
  2449. args: [
  2450. {
  2451. name: "Filename",
  2452. type: "string",
  2453. value: Compress.PKZIP_FILENAME
  2454. },
  2455. {
  2456. name: "Comment",
  2457. type: "string",
  2458. value: ""
  2459. },
  2460. {
  2461. name: "Password",
  2462. type: "binaryString",
  2463. value: ""
  2464. },
  2465. {
  2466. name: "Compression method",
  2467. type: "option",
  2468. value: Compress.COMPRESSION_METHOD
  2469. },
  2470. {
  2471. name: "Operating system",
  2472. type: "option",
  2473. value: Compress.OS
  2474. },
  2475. {
  2476. name: "Compression type",
  2477. type: "option",
  2478. value: Compress.COMPRESSION_TYPE
  2479. }
  2480. ]
  2481. },
  2482. "Unzip": {
  2483. description: "Decompresses data using the PKZIP algorithm and displays it per file, with support for passwords.",
  2484. run: Compress.runPkunzip,
  2485. inputType: "byteArray",
  2486. outputType: "html",
  2487. args: [
  2488. {
  2489. name: "Password",
  2490. type: "binaryString",
  2491. value: ""
  2492. },
  2493. {
  2494. name: "Verify result",
  2495. type: "boolean",
  2496. value: Compress.PKUNZIP_VERIFY
  2497. }
  2498. ]
  2499. },
  2500. "Bzip2 Decompress": {
  2501. description: "Decompresses data using the Bzip2 algorithm.",
  2502. run: Compress.runBzip2Decompress,
  2503. inputType: "byteArray",
  2504. outputType: "string",
  2505. args: []
  2506. },
  2507. "Generic Code Beautify": {
  2508. description: "Attempts to pretty print C-style languages such as C, C++, C#, Java, PHP, JavaScript etc.<br><br>This will not do a perfect job, and the resulting code may not work any more. This operation is designed purely to make obfuscated or minified code more easy to read and understand.<br><br>Things which will not work properly:<ul><li>For loop formatting</li><li>Do-While loop formatting</li><li>Switch/Case indentation</li><li>Certain bit shift operators</li></ul>",
  2509. run: Code.runGenericBeautify,
  2510. inputType: "string",
  2511. outputType: "string",
  2512. args: []
  2513. },
  2514. "JavaScript Parser": {
  2515. description: "Returns an Abstract Syntax Tree for valid JavaScript code.",
  2516. run: JS.runParse,
  2517. inputType: "string",
  2518. outputType: "string",
  2519. args: [
  2520. {
  2521. name: "Location info",
  2522. type: "boolean",
  2523. value: JS.PARSE_LOC
  2524. },
  2525. {
  2526. name: "Range info",
  2527. type: "boolean",
  2528. value: JS.PARSE_RANGE
  2529. },
  2530. {
  2531. name: "Include tokens array",
  2532. type: "boolean",
  2533. value: JS.PARSE_TOKENS
  2534. },
  2535. {
  2536. name: "Include comments array",
  2537. type: "boolean",
  2538. value: JS.PARSE_COMMENT
  2539. },
  2540. {
  2541. name: "Report errors and try to continue",
  2542. type: "boolean",
  2543. value: JS.PARSE_TOLERANT
  2544. },
  2545. ]
  2546. },
  2547. "JavaScript Beautify": {
  2548. description: "Parses and pretty prints valid JavaScript code. Also works with JavaScript Object Notation (JSON).",
  2549. run: JS.runBeautify,
  2550. inputType: "string",
  2551. outputType: "string",
  2552. args: [
  2553. {
  2554. name: "Indent string",
  2555. type: "binaryShortString",
  2556. value: JS.BEAUTIFY_INDENT
  2557. },
  2558. {
  2559. name: "Quotes",
  2560. type: "option",
  2561. value: JS.BEAUTIFY_QUOTES
  2562. },
  2563. {
  2564. name: "Semicolons before closing braces",
  2565. type: "boolean",
  2566. value: JS.BEAUTIFY_SEMICOLONS
  2567. },
  2568. {
  2569. name: "Include comments",
  2570. type: "boolean",
  2571. value: JS.BEAUTIFY_COMMENT
  2572. },
  2573. ]
  2574. },
  2575. "JavaScript Minify": {
  2576. description: "Compresses JavaScript code.",
  2577. run: JS.runMinify,
  2578. inputType: "string",
  2579. outputType: "string",
  2580. args: []
  2581. },
  2582. "XML Beautify": {
  2583. description: "Indents and prettifies eXtensible Markup Language (XML) code.",
  2584. run: Code.runXmlBeautify,
  2585. inputType: "string",
  2586. outputType: "string",
  2587. args: [
  2588. {
  2589. name: "Indent string",
  2590. type: "binaryShortString",
  2591. value: Code.BEAUTIFY_INDENT
  2592. }
  2593. ]
  2594. },
  2595. "JSON Beautify": {
  2596. description: "Indents and prettifies JavaScript Object Notation (JSON) code.",
  2597. run: Code.runJsonBeautify,
  2598. inputType: "string",
  2599. outputType: "string",
  2600. args: [
  2601. {
  2602. name: "Indent string",
  2603. type: "binaryShortString",
  2604. value: Code.BEAUTIFY_INDENT
  2605. }
  2606. ]
  2607. },
  2608. "CSS Beautify": {
  2609. description: "Indents and prettifies Cascading Style Sheets (CSS) code.",
  2610. run: Code.runCssBeautify,
  2611. inputType: "string",
  2612. outputType: "string",
  2613. args: [
  2614. {
  2615. name: "Indent string",
  2616. type: "binaryShortString",
  2617. value: Code.BEAUTIFY_INDENT
  2618. }
  2619. ]
  2620. },
  2621. "SQL Beautify": {
  2622. description: "Indents and prettifies Structured Query Language (SQL) code.",
  2623. run: Code.runSqlBeautify,
  2624. inputType: "string",
  2625. outputType: "string",
  2626. args: [
  2627. {
  2628. name: "Indent string",
  2629. type: "binaryShortString",
  2630. value: Code.BEAUTIFY_INDENT
  2631. }
  2632. ]
  2633. },
  2634. "XML Minify": {
  2635. description: "Compresses eXtensible Markup Language (XML) code.",
  2636. run: Code.runXmlMinify,
  2637. inputType: "string",
  2638. outputType: "string",
  2639. args: [
  2640. {
  2641. name: "Preserve comments",
  2642. type: "boolean",
  2643. value: Code.PRESERVE_COMMENTS
  2644. }
  2645. ]
  2646. },
  2647. "JSON Minify": {
  2648. description: "Compresses JavaScript Object Notation (JSON) code.",
  2649. run: Code.runJsonMinify,
  2650. inputType: "string",
  2651. outputType: "string",
  2652. args: []
  2653. },
  2654. "CSS Minify": {
  2655. description: "Compresses Cascading Style Sheets (CSS) code.",
  2656. run: Code.runCssMinify,
  2657. inputType: "string",
  2658. outputType: "string",
  2659. args: [
  2660. {
  2661. name: "Preserve comments",
  2662. type: "boolean",
  2663. value: Code.PRESERVE_COMMENTS
  2664. }
  2665. ]
  2666. },
  2667. "SQL Minify": {
  2668. description: "Compresses Structured Query Language (SQL) code.",
  2669. run: Code.runSqlMinify,
  2670. inputType: "string",
  2671. outputType: "string",
  2672. args: []
  2673. },
  2674. "Analyse hash": {
  2675. description: "Tries to determine information about a given hash and suggests which algorithm may have been used to generate it based on its length.",
  2676. run: Hash.runAnalyse,
  2677. inputType: "string",
  2678. outputType: "string",
  2679. args: []
  2680. },
  2681. "MD2": {
  2682. description: "The MD2 (Message-Digest 2) algorithm is a cryptographic hash function developed by Ronald Rivest in 1989. The algorithm is optimized for 8-bit computers.<br><br>Although MD2 is no longer considered secure, even as of 2014, it remains in use in public key infrastructures as part of certificates generated with MD2 and RSA.",
  2683. run: Hash.runMD2,
  2684. inputType: "string",
  2685. outputType: "string",
  2686. args: []
  2687. },
  2688. "MD4": {
  2689. description: "The MD4 (Message-Digest 4) algorithm is a cryptographic hash function developed by Ronald Rivest in 1990. The digest length is 128 bits. The algorithm has influenced later designs, such as the MD5, SHA-1 and RIPEMD algorithms.<br><br>The security of MD4 has been severely compromised.",
  2690. run: Hash.runMD4,
  2691. inputType: "string",
  2692. outputType: "string",
  2693. args: []
  2694. },
  2695. "MD5": {
  2696. description: "MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.<br><br>However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.",
  2697. run: Hash.runMD5,
  2698. inputType: "string",
  2699. outputType: "string",
  2700. args: []
  2701. },
  2702. "SHA0": {
  2703. description: "SHA-0 is a retronym applied to the original version of the 160-bit hash function published in 1993 under the name 'SHA'. It was withdrawn shortly after publication due to an undisclosed 'significant flaw' and replaced by the slightly revised version SHA-1.",
  2704. run: Hash.runSHA0,
  2705. inputType: "string",
  2706. outputType: "string",
  2707. args: []
  2708. },
  2709. "SHA1": {
  2710. description: "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.<br><br>However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.",
  2711. run: Hash.runSHA1,
  2712. inputType: "string",
  2713. outputType: "string",
  2714. args: []
  2715. },
  2716. "SHA224": {
  2717. description: "SHA-224 is largely identical to SHA-256 but is truncated to 224 bytes.",
  2718. run: Hash.runSHA224,
  2719. inputType: "string",
  2720. outputType: "string",
  2721. args: []
  2722. },
  2723. "SHA256": {
  2724. description: "SHA-256 is one of the four variants in the SHA-2 set. It isn't as widely used as SHA-1, though it provides much better security.",
  2725. run: Hash.runSHA256,
  2726. inputType: "string",
  2727. outputType: "string",
  2728. args: []
  2729. },
  2730. "SHA384": {
  2731. description: "SHA-384 is largely identical to SHA-512 but is truncated to 384 bytes.",
  2732. run: Hash.runSHA384,
  2733. inputType: "string",
  2734. outputType: "string",
  2735. args: []
  2736. },
  2737. "SHA512": {
  2738. description: "SHA-512 is largely identical to SHA-256 but operates on 64-bit words rather than 32.",
  2739. run: Hash.runSHA512,
  2740. inputType: "string",
  2741. outputType: "string",
  2742. args: []
  2743. },
  2744. "SHA3": {
  2745. description: "This is an implementation of Keccak[c=2d]. SHA3 functions based on different implementations of Keccak will give different results.",
  2746. run: Hash.runSHA3,
  2747. inputType: "string",
  2748. outputType: "string",
  2749. args: [
  2750. {
  2751. name: "Output length",
  2752. type: "option",
  2753. value: Hash.SHA3_LENGTH
  2754. }
  2755. ]
  2756. },
  2757. "RIPEMD-160": {
  2758. description: "RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.<br><br>RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.<br><br>RIPEMD-160 is an improved, 160-bit version of the original RIPEMD, and the most common version in the family.",
  2759. run: Hash.runRIPEMD160,
  2760. inputType: "string",
  2761. outputType: "string",
  2762. args: []
  2763. },
  2764. "HMAC": {
  2765. description: "Keyed-Hash Message Authentication Codes (HMAC) are a mechanism for message authentication using cryptographic hash functions.",
  2766. run: Hash.runHMAC,
  2767. inputType: "string",
  2768. outputType: "string",
  2769. args: [
  2770. {
  2771. name: "Password",
  2772. type: "binaryString",
  2773. value: ""
  2774. },
  2775. {
  2776. name: "Hashing function",
  2777. type: "option",
  2778. value: Hash.HMAC_FUNCTIONS
  2779. },
  2780. ]
  2781. },
  2782. "Fletcher-8 Checksum": {
  2783. description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.<br><br>The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",
  2784. run: Checksum.runFletcher8,
  2785. inputType: "byteArray",
  2786. outputType: "string",
  2787. args: []
  2788. },
  2789. "Fletcher-16 Checksum": {
  2790. description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.<br><br>The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",
  2791. run: Checksum.runFletcher16,
  2792. inputType: "byteArray",
  2793. outputType: "string",
  2794. args: []
  2795. },
  2796. "Fletcher-32 Checksum": {
  2797. description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.<br><br>The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",
  2798. run: Checksum.runFletcher32,
  2799. inputType: "byteArray",
  2800. outputType: "string",
  2801. args: []
  2802. },
  2803. "Fletcher-64 Checksum": {
  2804. description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.<br><br>The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.",
  2805. run: Checksum.runFletcher64,
  2806. inputType: "byteArray",
  2807. outputType: "string",
  2808. args: []
  2809. },
  2810. "Adler-32 Checksum": {
  2811. description: "Adler-32 is a checksum algorithm which was invented by Mark Adler in 1995, and is a modification of the Fletcher checksum. Compared to a cyclic redundancy check of the same length, it trades reliability for speed (preferring the latter).<br><br>Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32.",
  2812. run: Checksum.runAdler32,
  2813. inputType: "byteArray",
  2814. outputType: "string",
  2815. args: []
  2816. },
  2817. "CRC-32 Checksum": {
  2818. description: "A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.<br><br>The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of Ethernet and many other standards is the work of several researchers and was published in 1975.",
  2819. run: Checksum.runCRC32,
  2820. inputType: "byteArray",
  2821. outputType: "string",
  2822. args: []
  2823. },
  2824. "Generate all hashes": {
  2825. description: "Generates all available hashes and checksums for the input.",
  2826. run: Hash.runAll,
  2827. inputType: "string",
  2828. outputType: "string",
  2829. args: []
  2830. },
  2831. "Entropy": {
  2832. description: "Calculates the Shannon entropy of the input data which gives an idea of its randomness. 8 is the maximum.",
  2833. run: Entropy.runEntropy,
  2834. inputType: "byteArray",
  2835. outputType: "html",
  2836. args: [
  2837. {
  2838. name: "Chunk size",
  2839. type: "number",
  2840. value: Entropy.CHUNK_SIZE
  2841. }
  2842. ]
  2843. },
  2844. "Frequency distribution": {
  2845. description: "Displays the distribution of bytes in the data as a graph.",
  2846. run: Entropy.runFreqDistrib,
  2847. inputType: "byteArray",
  2848. outputType: "html",
  2849. args: [
  2850. {
  2851. name: "Show 0%'s",
  2852. type: "boolean",
  2853. value: Entropy.FREQ_ZEROS
  2854. }
  2855. ]
  2856. },
  2857. "Numberwang": {
  2858. description: "Based on the popular gameshow by Mitchell and Webb.",
  2859. run: Numberwang.run,
  2860. inputType: "string",
  2861. outputType: "string",
  2862. args: []
  2863. },
  2864. "Parse X.509 certificate": {
  2865. description: "X.509 is an ITU-T standard for a public key infrastructure (PKI) and Privilege Management Infrastructure (PMI). It is commonly involved with SSL/TLS security.<br><br>This operation displays the contents of a certificate in a human readable format, similar to the openssl command line tool.",
  2866. run: PublicKey.runParseX509,
  2867. inputType: "string",
  2868. outputType: "string",
  2869. args: [
  2870. {
  2871. name: "Input format",
  2872. type: "option",
  2873. value: PublicKey.X509_INPUT_FORMAT
  2874. }
  2875. ]
  2876. },
  2877. "PEM to Hex": {
  2878. description: "Converts PEM (Privacy Enhanced Mail) format to a hexadecimal DER (Distinguished Encoding Rules) string.",
  2879. run: PublicKey.runPemToHex,
  2880. inputType: "string",
  2881. outputType: "string",
  2882. args: []
  2883. },
  2884. "Hex to PEM": {
  2885. description: "Converts a hexadecimal DER (Distinguished Encoding Rules) string into PEM (Privacy Enhanced Mail) format.",
  2886. run: PublicKey.runHexToPem,
  2887. inputType: "string",
  2888. outputType: "string",
  2889. args: [
  2890. {
  2891. name: "Header string",
  2892. type: "string",
  2893. value: PublicKey.PEM_HEADER_STRING
  2894. }
  2895. ]
  2896. },
  2897. "Hex to Object Identifier": {
  2898. description: "Converts a hexadecimal string into an object identifier (OID).",
  2899. run: PublicKey.runHexToObjectIdentifier,
  2900. inputType: "string",
  2901. outputType: "string",
  2902. args: []
  2903. },
  2904. "Object Identifier to Hex": {
  2905. description: "Converts an object identifier (OID) into a hexadecimal string.",
  2906. run: PublicKey.runObjectIdentifierToHex,
  2907. inputType: "string",
  2908. outputType: "string",
  2909. args: []
  2910. },
  2911. "Parse ASN.1 hex string": {
  2912. description: "Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.<br><br>This operation parses arbitrary ASN.1 data and presents the resulting tree.",
  2913. run: PublicKey.runParseAsn1HexString,
  2914. inputType: "string",
  2915. outputType: "string",
  2916. args: [
  2917. {
  2918. name: "Starting index",
  2919. type: "number",
  2920. value: 0
  2921. },
  2922. {
  2923. name: "Truncate octet strings longer than",
  2924. type: "number",
  2925. value: PublicKey.ASN1_TRUNCATE_LENGTH
  2926. }
  2927. ]
  2928. },
  2929. "Detect File Type": {
  2930. description: "Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.<br><br>Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.",
  2931. run: FileType.runDetect,
  2932. inputType: "byteArray",
  2933. outputType: "string",
  2934. args: []
  2935. },
  2936. "Scan for Embedded Files": {
  2937. description: "Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.<br><br>WARNING: Files over about 100KB in size will take a VERY long time to process.",
  2938. run: FileType.runScanForEmbeddedFiles,
  2939. inputType: "byteArray",
  2940. outputType: "string",
  2941. args: [
  2942. {
  2943. name: "Ignore common byte sequences",
  2944. type: "boolean",
  2945. value: FileType.IGNORE_COMMON_BYTE_SEQUENCES
  2946. }
  2947. ]
  2948. },
  2949. "Expand alphabet range": {
  2950. description: "Expand an alphabet range string into a list of the characters in that range.<br><br>e.g. <code>a-z</code> becomes <code>abcdefghijklmnopqrstuvwxyz</code>.",
  2951. run: SeqUtils.runExpandAlphRange,
  2952. inputType: "string",
  2953. outputType: "string",
  2954. args: [
  2955. {
  2956. name: "Delimiter",
  2957. type: "binaryString",
  2958. value: ""
  2959. }
  2960. ]
  2961. },
  2962. "Diff": {
  2963. description: "Compares two inputs (separated by the specified delimiter) and highlights the differences between them.",
  2964. run: StrUtils.runDiff,
  2965. inputType: "string",
  2966. outputType: "html",
  2967. args: [
  2968. {
  2969. name: "Sample delimiter",
  2970. type: "binaryString",
  2971. value: StrUtils.DIFF_SAMPLE_DELIMITER
  2972. },
  2973. {
  2974. name: "Diff by",
  2975. type: "option",
  2976. value: StrUtils.DIFF_BY
  2977. },
  2978. {
  2979. name: "Show added",
  2980. type: "boolean",
  2981. value: true
  2982. },
  2983. {
  2984. name: "Show removed",
  2985. type: "boolean",
  2986. value: true
  2987. },
  2988. {
  2989. name: "Ignore whitespace (relevant for word and line)",
  2990. type: "boolean",
  2991. value: false
  2992. }
  2993. ]
  2994. },
  2995. "Parse UNIX file permissions": {
  2996. description: "Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.<br><br>Input should be in either octal (e.g. <code>755</code>) or textual (e.g. <code>drwxr-xr-x</code>) format.",
  2997. run: OS.runParseUnixPerms,
  2998. inputType: "string",
  2999. outputType: "string",
  3000. args: []
  3001. },
  3002. "Swap endianness": {
  3003. description: "Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.",
  3004. run: Endian.runSwapEndianness,
  3005. highlight: true,
  3006. highlightReverse: true,
  3007. inputType: "string",
  3008. outputType: "string",
  3009. args: [
  3010. {
  3011. name: "Data format",
  3012. type: "option",
  3013. value: Endian.DATA_FORMAT
  3014. },
  3015. {
  3016. name: "Word length (bytes)",
  3017. type: "number",
  3018. value: Endian.WORD_LENGTH
  3019. },
  3020. {
  3021. name: "Pad incomplete words",
  3022. type: "boolean",
  3023. value: Endian.PAD_INCOMPLETE_WORDS
  3024. }
  3025. ]
  3026. },
  3027. "Syntax highlighter": {
  3028. description: "Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.",
  3029. run: Code.runSyntaxHighlight,
  3030. highlight: true,
  3031. highlightReverse: true,
  3032. inputType: "string",
  3033. outputType: "html",
  3034. args: [
  3035. {
  3036. name: "Language/File extension",
  3037. type: "option",
  3038. value: Code.LANGUAGES
  3039. },
  3040. {
  3041. name: "Display line numbers",
  3042. type: "boolean",
  3043. value: Code.LINE_NUMS
  3044. }
  3045. ]
  3046. },
  3047. "Parse escaped string": {
  3048. description: "Replaces escaped characters with the bytes they represent.<br><br>e.g.<code>Hello\\nWorld</code> becomes <code>Hello<br>World</code>",
  3049. run: StrUtils.runParseEscapedString,
  3050. inputType: "string",
  3051. outputType: "string",
  3052. args: []
  3053. },
  3054. "TCP/IP Checksum": {
  3055. description: "Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.",
  3056. run: Checksum.runTCPIP,
  3057. inputType: "byteArray",
  3058. outputType: "string",
  3059. args: []
  3060. },
  3061. "Parse colour code": {
  3062. description: "Converts a colour code in a standard format to other standard formats and displays the colour itself.<br><br><strong>Example inputs</strong><ul><li><code>#d9edf7</code></li><li><code>rgba(217,237,247,1)</code></li><li><code>hsla(200,65%,91%,1)</code></li><li><code>cmyk(0.12, 0.04, 0.00, 0.03)</code></li></ul>",
  3063. run: HTML.runParseColourCode,
  3064. inputType: "string",
  3065. outputType: "html",
  3066. args: []
  3067. },
  3068. "Generate UUID": {
  3069. description: "Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).<br><br>A version 4 UUID relies on random numbers, in this case generated using <code>window.crypto</code> if available and falling back to <code>Math.random</code> if not.",
  3070. run: UUID.runGenerateV4,
  3071. inputType: "string",
  3072. outputType: "string",
  3073. args: []
  3074. },
  3075. "Substitute": {
  3076. description: "A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.<br><br>Enter the bytes you want to replace in the Plaintext field and the bytes to replace them with in the Ciphertext field.<br><br>Non-printable bytes can be specified using string escape notation. For example, a line feed character can be written as either <code>\\n</code> or <code>\\x0a</code>.<br><br>Byte ranges can be specified using a hyphen. For example, the sequence <code>0123456789</code> can be written as <code>0-9</code>.",
  3077. run: Cipher.runSubstitute,
  3078. inputType: "byteArray",
  3079. outputType: "byteArray",
  3080. args: [
  3081. {
  3082. name: "Plaintext",
  3083. type: "binaryString",
  3084. value: Cipher.SUBS_PLAINTEXT
  3085. },
  3086. {
  3087. name: "Ciphertext",
  3088. type: "binaryString",
  3089. value: Cipher.SUBS_CIPHERTEXT
  3090. }
  3091. ]
  3092. },
  3093. "To Morse Code": {
  3094. description: "Translates alphanumeric characters into International Morse Code.<br><br>Ignores non-Morse characters.<br><br>e.g. <code>SOS</code> becomes <code>... --- ...</code>",
  3095. run: MorseCode.runTo,
  3096. inputType: "string",
  3097. outputType: "string",
  3098. args: [
  3099. {
  3100. name: "Format options",
  3101. type: "option",
  3102. value: MorseCode.FORMAT_OPTIONS
  3103. },
  3104. {
  3105. name: "Letter delimiter",
  3106. type: "option",
  3107. value: MorseCode.LETTER_DELIM_OPTIONS
  3108. },
  3109. {
  3110. name: "Word delimiter",
  3111. type: "option",
  3112. value: MorseCode.WORD_DELIM_OPTIONS
  3113. }
  3114. ]
  3115. },
  3116. "From Morse Code": {
  3117. description: "Translates Morse Code into (upper case) alphanumeric characters.",
  3118. run: MorseCode.runFrom,
  3119. inputType: "string",
  3120. outputType: "string",
  3121. args: [
  3122. {
  3123. name: "Letter delimiter",
  3124. type: "option",
  3125. value: MorseCode.LETTER_DELIM_OPTIONS
  3126. },
  3127. {
  3128. name: "Word delimiter",
  3129. type: "option",
  3130. value: MorseCode.WORD_DELIM_OPTIONS
  3131. }
  3132. ]
  3133. },
  3134. "Tar": {
  3135. description: "Packs the input into a tarball.<br><br>No support for multiple files at this time.",
  3136. run: Compress.runTar,
  3137. inputType: "byteArray",
  3138. outputType: "byteArray",
  3139. args: [
  3140. {
  3141. name: "Filename",
  3142. type: "string",
  3143. value: Compress.TAR_FILENAME
  3144. }
  3145. ]
  3146. },
  3147. "Untar": {
  3148. description: "Unpacks a tarball and displays it per file.",
  3149. run: Compress.runUntar,
  3150. inputType: "byteArray",
  3151. outputType: "html",
  3152. args: [
  3153. ]
  3154. }
  3155. };