private-key

Java SFTP client that takes private key as a string

蹲街弑〆低调 提交于 2019-12-22 17:41:05
问题 Apache Commons and JSch both require a private key file to set up an SFTP connection. The project I'm working on will be used to connect to multiple SFTP servers. Therefore, we do not hope to deploy multiple private key files, but rather keep these keys as strings in an encrypted config file. Is there an SFTP library that doesn't require a file object for private key? 回答1: The JSch has an addIdentity method overload that takes the key from a buffer: public class JSch { ... public void

Encrypted Private Key to RSA Private Key

雨燕双飞 提交于 2019-12-22 08:38:00
问题 I have an Encrypted Private Key(say,servenc.key) in below format: -----BEGIN ENCRYPTED PRIVATE KEY----- MIIC2TBTBgkqhkiG9w0BBQ0wRjAlBgkqhkiG9w0BBQwwGAQSIFFvMaBFyBvqqhY6 yTV2fMVVAgIUczAdBglghkgBZQMEASoEEGRetyFtHhnJ7TZTM2qolWkEggKAFg/h GERtM1loEd+u8VAtLwTzBiXE5pmRpp/hX/1HrbBnzFjAsNtWlEtzpSuxuCoXtMst uKRB8qveHlfTQPzopkRZtljfOkD1DhdJz8BXSZrFmVkMrUq6m4Y/rnqTqI5JmtmQ qAXTBbl7u8TwMnqIaoSInEHnc+aiFT3KJuIq6PZy2rGKWGW2WB/OML2gANvHBI9n gyOo4VZHNsR6VBbCRJErUFhF5Wk2/YJD9ejnvXH6pJFqZYvnCFjkSlR+4MdCHBSo

GitLab SSH keys stopped working

一笑奈何 提交于 2019-12-22 04:20:46
问题 OK, I've stumbled on this topic many times, but this is the first time that none of the regular solutions worked. I have a CentOS 6.4 server running GitLab. It's been working great with 20+ users and 60+ projects, but about 5 hours ago, my main staging server was unable to connect to the GitLab machine for the first time using key authentication and it prompted for password. I regenerated the RSA key and added it to my deploy keys, but that failed as well. Next, I tried to create a new user

Specifying private key on PuTTY command-line

风流意气都作罢 提交于 2019-12-22 03:29:42
问题 I know there are simple commands to login to remote machine through VBA i.e. by specifying User@hostname and -pw option to provide the password in Wshell.Run function where Wshell is CreateObject("WScript.Shell") . However I need to use private key file (specified under Connection/SSH/Auth option in PuTTY) while logging in through Excel-VBA macro. Is there a way to do it? I need it because I am using admin account on the second form of my VBA code (First form is using user's own account) and

RSA: Private key calculation with Extended Euclidean Algorithm

主宰稳场 提交于 2019-12-21 03:18:14
问题 I'm a high school student writing a paper on RSA, and I'm doing an example with some very small prime numbers. I understand how the system works, but I can't for the life of me calculate the private key using the extended euclidean algorithm. Here's what I have done so far: I have chosen the prime numbers p=37 and q=89 and calculated N=3293 I have calculated (p-1)(q-1)=3168 I have chosen a number e so that e and 3168 are relatively prime. I'm checking this with the standard euclidean

RSA 2048 Encryption Decryption - Exception

那年仲夏 提交于 2019-12-21 03:12:18
问题 I am trying to encrypt and decrypt the data with RSA 2048. We have one public key and private key and will be using same throughout. but the problem is, when I decrypt, I am getting javax.crypto.BadPaddingException: Data must start with zero File file = new File("C:\\temp-ldi\\pubkey.txt"); FileWriter writer = new FileWriter(file); file.createNewFile(); encryptedText = RSACrypto.encrypt("PLAIN TEXT"); //no argument of pub-key, generate key pair writer.write(new BASE64Encoder().encode

Paramiko — using encrypted private key file on OS X

余生长醉 提交于 2019-12-20 18:29:06
问题 I'm trying to use Paramiko to connect to an SSH server from Python. This is what I tried so far: >>> import paramiko >>> import os >>> privatekeyfile = os.path.expanduser('~/.ssh/id_rsa') >>> mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/pkey.py", line 198, in from_private_key_file key = cls(filename=filename,

How can I convert the private key stored in HSM to SignedXml.SigningKey in C#

吃可爱长大的小学妹 提交于 2019-12-19 04:35:11
问题 I'm trying to implement some demo of XML signing with a certificate which stored in the HSM. I found some interesting example from this link: Sign XML Document with X509Certificate2 and modified it to using certificate and key inside the HSM with PKCS11Interop wrapper. But anyone could give me a suggestion or example to convert ObjectHandle privateKey from HSM to SignedXML.SigningKey private static void SignXmlWithCertificate(XmlDocument xmlDoc, X509Certificate2 cert, Session session, String

JSch how to use with PuTTY private key

烈酒焚心 提交于 2019-12-19 04:19:08
问题 I'm trying to use JSch with a private key configuration. I've generated a public and private key using PuTTYgen but am unsure what to do with both of the files. Which key (public/private) needs transferring to the server? 回答1: First, you need to register your PuTTYgen-generated public key on the server. See Getting ready for public key authentication or (my) Set up SSH public key authentication. And finally see Can we use JSch for SSH key-based communication? for details on using the private

hash_hmac sha512 authentication in python

佐手、 提交于 2019-12-19 04:02:35
问题 I'm trying to write python authentication bot for: https://comkort.com/page/private_api There is no full php example. I'm guess somebody could put it here. There is only snippet of php code: $query_string = http_build_query($_POST, '', '&'); $ethalon_sign = hash_hmac("sha512", $query_string, $api_secret_key); How to write authentication on python with hash_hmac sha512 ? I want to extract my open orders POST https://api.comkort.com/v1/private/order/list . My current variant is: import hashlib