OperationConfig.js 118 KB

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