public-key-encryption

RSA Java encryption and Node.js decryption is not working

丶灬走出姿态 提交于 2019-12-03 03:17:00
I have a system that requires a RSA keypair to be generated in javascript, have the public key then stored in a database at the server side (as a string), then the server side which is in Java will encrypt a string with the stored public key and send it to the client side which will decrypt the string with the private key. I'm using a browsified version of node-rsa on my client browser. First at the client i generate a keypair and export the keys, storing them as strings var NodeRSA = require('node-rsa'); var key = new NodeRSA({b: 1024}); key.exportKey("pkcs8-private"); key.exportKey("pkcs8

Setting up OpenSSH for Windows using public key authentication

你离开我真会死。 提交于 2019-12-03 02:46:45
问题 I am having issues setting up OpenSSH for Windows, using public key authentication. I have this working on my local desktop and can ssh with a key from Unix machines or other OpenSSH for Windows machines. I have replicated the build onto a server, I can get password authentication working fine, but when I use the keys I get the following issue: debug1: Authentications that can continue: publickey,password,keyboard-interactive debug3: start over, passed a different list publickey,password

HSM Error | Private key must be instance of RSAPrivate(Crt)Key or have PKCS#8

独自空忆成欢 提交于 2019-12-03 00:49:46
Error received while decrypting data when private key is retrieved from HSM. I have added sunpkcs11 provider in java.security. Hence, NOT adding provider via code. Text gets encrypted successfully. However, while decrypting the encrypted text, I am getting below error at below line: cipher.init(Cipher.DECRYPT_MODE, privateKey); What is that i am missing here? Error: Caused by: java.security.InvalidKeyException: Private key must be instance of RSAPrivate(Crt)Key or have PKCS#8 encoding at sun.security.pkcs11.P11RSAKeyFactory.implTranslatePrivateKey(P11RSAKeyFactory.java:101) [sunpkcs11.jar:1.7

Which symmetric key algorithm does SSL use?

大城市里の小女人 提交于 2019-12-02 23:21:43
I understand that through SSL, the browser gets the public key of the secured website and through public key encryption rsa algorithm, these 2 establish session key and then continue communication thru some symmetric algorithm, because symmetric key encryption/decryption is faster. Which symmetric key algorithm does SSL use? DES? AES? or something else? When the client connects to the server, it negotiates a so-called ciphersuite (combination of encryption, key exchange, authentication algorithms) to use. Each SSL client or server has a list of allowed ciphersuites and during handshake the

How to implement OpenSSL functionality in Python?

点点圈 提交于 2019-12-02 23:18:07
I would like to encrypt a secret text by public-key and decrypt it by private-key in Python. I can achieve that with the openssl command: echo "secrettext/2011/09/14 22:57:23" | openssl rsautl -encrypt -pubin -inkey public.pem | base64 data.cry base64 -D data.cry | openssl rsautl -decrypt -inkey private.pem How would one implement that in Python? jfs Encrypt #!/usr/bin/env python import fileinput from M2Crypto import RSA rsa = RSA.load_pub_key("public.pem") ctxt = rsa.public_encrypt(fileinput.input().read(), RSA.pkcs1_oaep_padding) print ctxt.encode('base64') Decrypt #!/usr/bin/env python

how to convert raw modulus & exponent to RSA public key (.pem format)

两盒软妹~` 提交于 2019-12-02 19:39:49
I have the modulus & exponent of an RSA public key embedded into a binary file, and I am trying to extract the entire blob and create a usable .pem public key. Currently, I am extracting the full 260 bytes (4 bytes for the exponent, 256 bytes for the modulus) and encoding as base64. I am doing that using the following shell command : tail -c $((filesize - start_of_key_data)) filename | head -c $size_of_key_data | base64 > outkey This gives me the following string : <<<<<< modulus & exponent extracted from binary file, base64-encoded >>>>>> tZyrQA6cZFJfVm6FyXwtZaLQYg8EecuO+ObrHTwc8JO

Rainbow tables as a solution to large prime factoring

做~自己de王妃 提交于 2019-12-02 17:55:30
In explanations I've read about public key cryptography, it is said that some large number is come up with by multiplying together 2 extremely large primes. Since factoring the product of large primes is almost impossibly time-consuming, you have security. This seems like a problem that could be trivially solved with rainbow tables. If you know the approximate size of primes used and know there are 2 of them, you could quickly construct a rainbow table. It'd be a mighty large table, but it could be done and the task could be parallelized across hardware. Why are rainbow tables not an effective

Setting up OpenSSH for Windows using public key authentication

爷,独闯天下 提交于 2019-12-02 15:13:42
I am having issues setting up OpenSSH for Windows, using public key authentication. I have this working on my local desktop and can ssh with a key from Unix machines or other OpenSSH for Windows machines. I have replicated the build onto a server, I can get password authentication working fine, but when I use the keys I get the following issue: debug1: Authentications that can continue: publickey,password,keyboard-interactive debug3: start over, passed a different list publickey,password,keyboard-interactive debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup

X.509 Digital Signatures/Encryption workflow/library recommendations?

微笑、不失礼 提交于 2019-12-02 04:22:00
问题 My particular use case is that I have to access digital certificates stored on the client, and use them to perform tasks of signing, verifying, encryption and decryption on the client side and the server side. For the latter part, there are many many solutions. The sticking point is the ability to access certificates stored on the client. Note that I am saying "certificates stored on the client" which is deliberately vague. I dont want to restrict thoughts to system store, user store, browser

'Cannot find the requested object' exception while creating X509Certificate2 from string

耗尽温柔 提交于 2019-12-01 14:45:26
问题 I am trying to create X509Certificate2 from string. Let me show an example: string keyBase64String = Convert.ToBase64String(file.PKCS7); var cert = new X509Certificate2(Convert.FromBase64String(keyBase64String)); and keyBase64String has a such content: "MIIF0QYJKoZI ........hvcNAQcCoIIFwjCCBb4CA0=" and file.PKCS7 is byte array which I downloaded from database . I've got the following exception when creating X509Certificate2 : Cannot find the requested object And the stack trace: "Cannot find