How to Encrypt dgn file using externel dll?

We have our own encrypt mechanism . We would like to implement it when save action triggers.

Also we would like to decrypt it when open action triggers.

We tried with Read and Write API hooking. But its not Succeeded.

Is there any possible way to do it?

Thanks in Advance.