Skip to content

Commit 5aae898

Browse files
committed
update README with magic op
1 parent d84d7a9 commit 5aae898

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ A Docker image can be built, then run by doing the following:
4848
## API overview
4949
> For full documentation of the API, you can find the swagger page hosted at the root url. See [Installing](#Installing) to run the application and browse the docs.
5050
51-
Currently the server just has one endpoint: `/bake`. This endpoint accepts a POST request with the following body:
51+
The server has two endpoints: `/bake` and `/magic`.
52+
53+
### `/bake`
54+
55+
`/bake` allows a user to POST some input and configuration for a CyberChef Recipe. The application will run the input through the recipe and return the baked operation.
56+
57+
This endpoint accepts a POST request with the following body:
5258

5359
|Parameter|Type|Description|
5460
|---|---|---|
@@ -160,6 +166,53 @@ Response:
160166
}
161167
```
162168

169+
### `/magic`
170+
171+
[Find more information about what the Magic operation does here](https://github.com/gchq/CyberChef/wiki/Automatic-detection-of-encoded-data-using-CyberChef-Magic)
172+
173+
The Magic operation cannot be used in conjunction with other applications in the `/bake` endpoint.
174+
175+
176+
|Parameter|Type|Description|
177+
|---|---|---|
178+
input|String|The input data for the recipe. Currently accepts strings.
179+
args|Object or Array|Arguments for the magic operation
180+
181+
#### Example: detecting hex
182+
```javascript
183+
{
184+
"input": "4f 6e 65 2c 20 74 77 6f 2c 20 74 68 72 65 65 2c 20 66 6f 75 72 2e"
185+
}
186+
```
187+
Response:
188+
```javascript
189+
{
190+
"value": [
191+
{
192+
"recipe": [
193+
{ "op": "From Hex", "args": [ "Space" ] }
194+
],
195+
"data": "One, two, three, four.",
196+
"languageScores": [
197+
{ "lang": "en", "score": 442.77940826119266, "probability": 2.8158586573567845e-12 },
198+
{ "lang": "de", "score": 555.3142876037181, "probability": 0 },
199+
{ "lang": "pl", "score": 560.9378201619123, "probability": 0 },
200+
...
201+
],
202+
"fileType": null,
203+
"isUTF8": true,
204+
"entropy": 3.5383105956150076,
205+
"matchingOps": [],
206+
"useful": false,
207+
"matchesCrib": null
208+
},
209+
...
210+
],
211+
"type":6
212+
}
213+
```
214+
215+
163216
## Licencing
164217

165218
CyberChef-server is released under the [Apache 2.0 Licence](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/).

0 commit comments

Comments
 (0)