rsa

RSA decryption using only n e and c

醉酒当歌 提交于 2020-05-26 04:32:28
问题 I need to decrypt c and I was given only n, e and c and computing p and q or phi(n) would be close to impossible so what other alternatives do I have? I tried calculating p and q but I made very little progress with the search in the last 24 hours of continuous running the program. These are the values I was given: n: 58900433780152059829684181006276669633073820320761216330291745734792546625247 e: 65537 c: 56191946659070299323432594589209132754159316947267240359739328886944131258862 Also, in

How can I encrypt with a RSA private key in python?

荒凉一梦 提交于 2020-05-25 07:49:44
问题 Is it possible to encrypt a message with a private key in python using pycryptodome or any other library? I know that you are not supposed to encrypt with the private key and decrypt with the public key, but my purpose is to encrypt with the private one so the receiver could be sure that the message was send by the real author. More than secure encryption I'm looking for some kind of obfuscation. I want to do an app where the message is public but it can only be seen if you have the public

cannot invoke initializer for Unmanaged<AnyObject>? with no arguments in swift

你。 提交于 2020-05-18 20:16:30
问题 what I want is to convert RSA Sec key into base64 encoded string with swift. so I initialized a variable like below, var publicKeyBits = Unmanaged<AnyObject>?() then it gives cannot invoke initializer for Unmanaged? with no arguments in swift I want to covert my publickey like below var publicKeyBits = Unmanaged<AnyObject>?() SecItemCopyMatching(queryAttrs, &publicKeyBits) let opaqueBits = publicKeyBits?.toOpaque() let publicKeyData = Unmanaged<NSData>.fromOpaque(opaqueBits)

Trouble loading RSA public key from file

扶醉桌前 提交于 2020-05-16 03:17:26
问题 I've been using openssl library in my C++ project recently, and I'm facing an issue that i can't fix by myself. I'm actually trying to load an RSA public key stored in a file and encrypt 64 bytes. My code works when it uses a public key generated using the function RSA_generate_key, but when i'm using my own public key, it won't work anymore for some reason. I've suspected key format from pkcs1 pkcs8, tried both PEM_read_RSAPublicKey and PEM_read_RSA_PUBKEY, still not working for some reason.

Generating an RSA key pair in powershell

房东的猫 提交于 2020-05-15 05:01:49
问题 I want to generate an RSA public private key pair in powershell without using external software and I want to test it. It should be able to encrypt/decrypt data on any online public/private key verification service. Purpose- Strictly Educational. I'm very well aware that you shouldn't export your private key online for security purposes. So far I've tried ssh-keygen and $RSA = New-Object System.Security.Cryptography.RSACryptoServiceProvider(2048) [System.Convert]::ToBase64String($rsa

Retrieve SecKey from RSA private key string encoded with passphrase in Swift or Objective C

旧街凉风 提交于 2020-05-13 13:25:10
问题 We have an enterprise mobile app that ships with an encrypted private key. We intend to provide users with the passphrase in order to use that private key, which will then allow them to communicate with a backend server. I've previously set this up using Python or C# but cannot figure out how to do this in Swift or Objective C. I've adapted some of this from this stack overflow question: Encrypt using RSA Certificate in Swift static func getCertificate(from certificate: String?, usingPhrase

Java - Auth0 JWT Verification - Is this correct?

元气小坏坏 提交于 2020-05-11 07:17:22
问题 I'm setting up a REST API with Auth0 as the authentication service. Everything is working but my confidence has been a bit shaken after a rather strange occurrence. My implementation is based on the sample code here (The RS256 section) and here. The only modification being that I cast the PublicKey to an RSAPublicKey . The issue is that I wanted to be positive that the verification would fail on a bad signature. I changed the signature's last character (we'll say "x") and the token still

Java - Auth0 JWT Verification - Is this correct?

元气小坏坏 提交于 2020-05-11 07:14:10
问题 I'm setting up a REST API with Auth0 as the authentication service. Everything is working but my confidence has been a bit shaken after a rather strange occurrence. My implementation is based on the sample code here (The RS256 section) and here. The only modification being that I cast the PublicKey to an RSAPublicKey . The issue is that I wanted to be positive that the verification would fail on a bad signature. I changed the signature's last character (we'll say "x") and the token still

WAS Server - Event Viewer error and IIS Log Error

☆樱花仙子☆ 提交于 2020-04-30 06:37:05
问题 I am trying to start WAS service and I got this error from Event Viewer. Windows Process Activation Service (WAS) is stopping because it encountered an error. The data field contains the error number. So then I checked the error from iis.log file [04/21/2020 11:31:00] [ ***** IIS 10.0 Component Based Setup ***** ] [04/21/2020 11:31:00] .\inetsrv\iissetup.exe /keygen [04/21/2020 11:31:00] Created NetFrameworkConfigurationKey key containter [04/21/2020 11:31:00] Created

Decrypt an RSA message from browser with window.crypto.subtle APIs

雨燕双飞 提交于 2020-04-30 04:28:51
问题 I'm trying to decode an RSA 2048 bit message encoded with a public key using the corresponding private key. The environment is google chrome and I'm using the window.crypto.subtle APIs. I generated the key couple and encoded the message using openssl tools: # generate keys and put the private one in file private_key.pem openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048 # extract public key in file public_key.pem openssl rsa -pubout -in private_key.pem -out