encryption-asymmetric

RSA Encryption of large data in C#

浪子不回头ぞ 提交于 2019-11-30 09:17:05
This is my first post, so hope I haven't missed anything important. I'm doing a project in C# where I need to use public/private key encryption to encrypt a message and then send it over an SSL connection. I chose to use the RSACryptoService , as according to the documentation, that was the only asymmetric encryption scheme used for encrypting data. The problem is that I am having a lot of problems with this. (I wanted to do symmetric encryption, but that is not what my teacher want me to do, and according to him it should be easy to just determine a block size and then it should do all the

Java RSA Encrypt - Decrypt .NET

左心房为你撑大大i 提交于 2019-11-30 07:17:40
I am encrypting on JAVA using RSA and attempting to decrypt using .NET. I am including my JAVA code and .NET code in hopes that someone has some experience with this sort of thing. JAVA Code: byte[] modulusBytes = Base64.decode("xTSiS4+I/x9awUXcF66Ffw7tracsQfGCn6g6k/hGkLquHYMFTCYk4mOB5NwLwqczwvl8HkQfDShGcvrm47XHKUzA8iadWdA5n4toBECzRxiCWCHm1KEg59LUD3fxTG5ogGiNxDj9wSguCIzFdUxBYq5ot2J4iLgGu0qShml5vwk="); byte[] exponentBytes = Base64.decode("AQAB"); BigInteger modulus = new BigInteger(1, modulusBytes ); BigInteger exponent = new BigInteger(1, exponentBytes); RSAPublicKeySpec rsaPubKey = new

Decrypting “long” message encrypted with RSA java

好久不见. 提交于 2019-11-30 05:49:05
Hi this is the same question, that was asked two years ago: Java/JCE: Decrypting “long” message encrypted with RSA I had a large byte array and rsa keypair, initiated by value 1024. Using rsa encryption and the specified size of the key is strong requirement, I can't change it. So I can't use symmetric encryption with asymetric encryption symmetric key. I can't use any other keys. I had a byte array and need ciphered byte array to be returned. I wonder if there is any ready tool, that can manage with this problem? Sorry for such an amateurish question, but I really need a help. As stated, your

rsacryptoserviceprovider using x509 certificates c#

六眼飞鱼酱① 提交于 2019-11-30 05:19:33
i am using a certificate generated by makecert which has both private and public key. The java side uses this public key to encrypt the data and .net decrypts it back. I am trying to decrypt Java's encrypted 64 bit encoded string and getting bad data. To see if all is good on.Net end, I frist tried to encrypt with the public key and then decrypt with private using the same certificate. My code looks like this. X509Certificate2 cert = GetCert(key, StoreName.My, StoreLocation.LocalMachine); RSACryptoServiceProvider provider = (RSACryptoServiceProvider)cert.PrivateKey; RSACryptoServiceProvider

Deterministic RSA encryption in Java

﹥>﹥吖頭↗ 提交于 2019-11-30 02:52:26
This is my first question on this site, and I only have a basic mathematical understanding of RSA, so please bear with me! :) I'm writing a Java web application for my final year project at university. It's a web-based implementation of "Pret-a-voter", a secure voting system, for those who have heard of it. Essentially my problem is that I want to be able to give someone performing the role of an auditor: a source byte array (the plaintext to be encrypted) an RSA public key file a " destination " byte array, which is the result of my own computation of the cipherdata given the plaintext and

Cracking short RSA keys

天涯浪子 提交于 2019-11-29 18:43:47
Given the following RSA keys, how does one go about determining what the values of p and q are? Public Key: (10142789312725007, 5) Private Key: (10142789312725007, 8114231289041741) Your teacher gave you: Public Key: (10142789312725007, 5) which means n = 10142789312725007 e = 5 where n is the modulus and e is the public exponent. In addition, you're given Private Key: (10142789312725007, 8114231289041741) meaning that d = 8114231289041741 where d is the decryption exponent that should remain secret. You can "break" RSA by knowing how to factor "n" into its "p" and "q" prime factors: n = p * q

Hybrid cryptosystem implementation in .net. Error Specified key is not a valid size for this algorithm

大兔子大兔子 提交于 2019-11-29 18:10:15
I am trying to implement hybrid cryptosystem as mentioned in https://en.wikipedia.org/wiki/Hybrid_cryptosystem At the moment I have implemented following algorithm private void button1_Click(object sender, EventArgs e) { CspParameters cspParams = new CspParameters { ProviderType = 1 }; RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(1024, cspParams); string publicKey = Convert.ToBase64String(rsaProvider.ExportCspBlob(false)); string privateKey = Convert.ToBase64String(rsaProvider.ExportCspBlob(true)); string symmericKey = "Kamran12"; txtEncryptedData.Text = EncryptData

RSA Encryption of large data in C#

半城伤御伤魂 提交于 2019-11-29 14:48:37
问题 This is my first post, so hope I haven't missed anything important. I'm doing a project in C# where I need to use public/private key encryption to encrypt a message and then send it over an SSL connection. I chose to use the RSACryptoService , as according to the documentation, that was the only asymmetric encryption scheme used for encrypting data. The problem is that I am having a lot of problems with this. (I wanted to do symmetric encryption, but that is not what my teacher want me to do,

Asymmetric Crypto on Android

时光总嘲笑我的痴心妄想 提交于 2019-11-29 11:13:19
I would like to ask if i can use Asymmetric Crypto (like RSA or ECC) on android mobile phones, how, and what are the best libraries i should use. Because it is Java, you can use the Bouncy Castle Cryptographic Library :) http://www.bouncycastle.org/java.html You can use RSA or ElGamal for Asymmetric Cryptography :) http://www.bouncycastle.org/specifications.html 来源: https://stackoverflow.com/questions/3127267/asymmetric-crypto-on-android

rsacryptoserviceprovider using x509 certificates c#

拟墨画扇 提交于 2019-11-29 03:28:40
问题 i am using a certificate generated by makecert which has both private and public key. The java side uses this public key to encrypt the data and .net decrypts it back. I am trying to decrypt Java's encrypted 64 bit encoded string and getting bad data. To see if all is good on.Net end, I frist tried to encrypt with the public key and then decrypt with private using the same certificate. My code looks like this. X509Certificate2 cert = GetCert(key, StoreName.My, StoreLocation.LocalMachine);