I'm writing Ruby app and I want to use some top-secret algorithms. So how would be the best to protect them from unauthorized access.

I have 2 ideas:

* write them in C and load using FFI (I wonder if It's possible this way)
* Marshal ruby code, encode it and then store in file

Maybe someone know better idea or can show me that these ideas are stupid or wrong. Thanks in advice.