$ ctf42

Old_Calculator

Crypto weight 85.12 No technique tags yet.
Difficulty Not rated yet

Flag format: Securinets{...}

Cryptography pts We had a 4-bit calculator capable of performing simple operations and storing their results. My little brother kept repeating the same operation until its tiny memory was full. Luckily, I managed to upgrade it to 8 bits, giving it 200 bytes of memory: 100 bytes for inputs and 100 bytes for results. There's just one catch: the calculator erases its entire history as soon as I display the results. Can you figure out what he was doing before it's too late?

Interacting with the Server

To interact with the server, send a JSON request in one of the formats below. Specify the operation, the source array(s), the indices, a const (if applicable), and the destination array and index where the result is stored. x,y are table with size of 100

// Add x[2]=x[0]*x[1]
{"operation":"add","source":["x","x"],"source_index1":0,"source_index2":1,"destination":"x","dest_index":2}

// Multiply y[2]=x[0]*y[1]
{"operation":"mult","source":["x","y"],"source_index1":0,"source_index2":1,"destination":"y","dest_index":2} 


// Add constant y[2]=x[0]+10
{"operation":"add_const","source":"x","index":0,"const":10,"destination":"y","dest_index":1}

// Multiply constant x[5]=y[1]+5
{"operation":"mult_const","source":"y","index":1,"const":5,"destination":"x","dest_index":5}

Submiting

# Submit to get the value of x (input) or y (output) in the chosen index
'{"operation": "submit", "source": "x", "index": 0}'

You will be tested 16 time then you will be given the flag :)

F(x)=y you need to find whats F really does

PS : this MD is generated by claude :)

Writeups

Official

No official writeup linked.

Community

No community writeups yet. Solved it? Share how.

Log in to add a community writeup.