Part of my decryption process is using a RSA private key to decrypt part of my data. I store my private RSA Key on a separate server (as well as the password for the private RSA Key) from where I process the decryption request.
Decryption of information in my SQL database happens a lot. So I am trying to figure out the most efficient way to grab my key and the password to the key so I don't bog down the server too much.
note: I do not know how much strain this puts on a server so I may be completely wrong
Right now, the only way I can think about doing it is SSH'ing into the server and grabbing the file contents and then closing the request.
Does anyone have any suggestions?
Something along the lines of this:
$connection = ssh2_connect('domain.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$file = fopen("ssh2.sftp://$sftp/path/to/file", 'r');