r/cryptography • • 14d ago

algorithm replicating

if i have secure implementation of algorithm in 1 language and i wana port it to other language and they dont have compiler is there secure way to do it?

0 Upvotes

11 comments sorted by

View all comments

2

u/Natanael_L 14d ago

Why wouldn't there be a compiler?

You can do it if you understand all the requirements of the first implementation (RNG management, memory protection, constant time behavior, etc), and if you know how to replicate these same properties in the target language. It will take a fair bit of reverse engineering and the target needs to be able to provide the requirements (like having a secure RNG available).

1

u/rvg0291 14d ago

what if source language uses syscalls wich target doesnt have

1

u/Natanael_L 14d ago

What kind of syscalls? You'd have to model what the calls do and figure out if they're necessary and if they can be replicated.

For cryptographic algorithms, the only common syscalls are memory access and RNG calls. If you don't have an RNG available you've got problems, unless the algorithm is deterministic.

1

u/rvg0291 13d ago

thats hard to replace syscalls i know that they dont need syscalls but some librarys still have them including console syscalls to make cli,lib loading syscalls,rng syscalls and its hard top replicate them also i need final algorithm to have finite memory and time wich starting algorithms dont cus they have unbounded/conditonal while loops