duandang2838 2014-09-03 22:39
浏览 26
已采纳

从另一台服务器访问RSA密钥

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');
  • 写回答

1条回答 默认 最新

  • duanmei2459 2014-09-03 22:52
    关注

    I dont know why u store ur RSA key and password on another server because if your Server can access them using any way, a hacker can do the same thing. In your code, the hacker just need to SSH into the server using the hardcoded username and password.

    In case of SSH connection, it is also not a good idea put them into part of web request ( I assume it is a web application since I saw PHP :) ). SSH connection takes a huge amount of time to establish.

    A lighter solution is to create a https web server on your RSA key server and only white list your Web server ip address. It is same encryption as SSH (SSL) but much faster.

    Again, it seems not necessary to put the RSA key and password on another server according to your scenario.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog