public-key-encryption

OpenSSL Encryption of Session Key

有些话、适合烂在心里 提交于 2019-12-29 09:30:15
问题 I am writing a method that encrypts session keys. It needs to do this such that the key can be decrypted by a different program that has been tested successfully. The decryption program cannot change. Where I am stuck is on getting my encryption to work in a way that it aligns with the decryption routine. Let me give the decryption routine first. Remember, this cannot change: public Boolean decryptSessionKey() { // first, base64 decode the session key String sslString = "openssl base64 -d -in

How to encrypt a .jar file

大兔子大兔子 提交于 2019-12-28 06:26:05
问题 I'm working in a project where we need to encrypt the .jar file so no one can access to the .class files which inside the jar file.... is there any java coding which can help me to encrypt the .jar file ? 回答1: Even if you encrypt the jar file, it must be decrypted before the JVM is able to run it, so you'll need another jar file containing classes that decrypt and loads in the JVM. Since this second jar file cannot be itself encrypted, a malicious user wanting to see you class files, can

Server refused our key, set authorized_keys perrmissions to 777

我只是一个虾纸丫 提交于 2019-12-25 09:46:20
问题 I was copying some files from my home directory on my ec2 instance, and in a fit of laziness, I ran the command sudo chmod 777 /home/ec2-user/*. I guess this made my .ssh folder and possibly the authorized_keys have 777 privileges as well. Well it turns out that if authorized_keys is set to 777, you cannot SSH into the box with those keys (since another user could have updated it). My question is, how can I fix this and log into my box again? This is an ec2 instance, so I have to ssh in. 回答1:

set Modulus and Exponent from VB.Net to Android/Java

£可爱£侵袭症+ 提交于 2019-12-25 09:16:02
问题 I have this RSA public key which is generated in VB.Net my server. <RSAKeyValue><Modulus>tv0tzng4pW7erDo2ke/Ku9TGKRukAzx+lihZVblIOE6GWIoiwlILOANeVliZLi1s5qMsXEUA4GV2woC1zFdhJvfFja8Nacl4I3CJ4JYmGqcSZinWKgo3MJdoEqFl9NliF4wTYLow3GYoUh03WxoeArozV1S03drP898b9PdbjPY+ji4jpZHJWnbfg+qWSziF1Q/pSAxpzabeoamz1+ekqlhuxZavQUl+hIhx/quHqy3ybFWcX6yE5NKeY1fzX3L7</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> I want to set this value to my android RSA public key but converting with this code doesn't set the

Is Base64 an encryption or encoding algorithm?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 03:32:08
问题 I have to use an encryption algorithm using Base64 but when I researched online I find forums state it is an encoding algorithm. This has me confused. :( Is Base64 an encryption or encoding algorithm? How do we differentiate between the two except for the fact that one is publicly decipherable while the other needs a key for that? 回答1: It's an encoding algorithm (hence "Base64 encoding") to allow people to move data in an ASCII friendly environment (i.e. no control characters or anything non

Is Base64 an encryption or encoding algorithm?

三世轮回 提交于 2019-12-25 03:32:06
问题 I have to use an encryption algorithm using Base64 but when I researched online I find forums state it is an encoding algorithm. This has me confused. :( Is Base64 an encryption or encoding algorithm? How do we differentiate between the two except for the fact that one is publicly decipherable while the other needs a key for that? 回答1: It's an encoding algorithm (hence "Base64 encoding") to allow people to move data in an ASCII friendly environment (i.e. no control characters or anything non

determine if the bits are encrypted?

假如想象 提交于 2019-12-25 03:06:21
问题 let's assume that I am listening a network , and I acquired some bits, but I want to know if there is a way to determine bits are encrypted ? what method or algorithm exists ? I mean if the bits are meaningless, it means encrypted but is there are more technical approach or algorithm to determine from bits let's say I have 0101010100001011001001100001001, how would you tell that if this is encrypted ? 回答1: Generally speaking, you can't. Encrypted data is, in almost all cases,

Manual implementation RSA java. Padding ideas

喜夏-厌秋 提交于 2019-12-25 03:04:52
问题 I am implementing RSA manually on java (yes i know not the best idea but it is for university purposes). My algorithm is working good enough with small texts but when big texts come into consideration the algorithm breaks as the number of bits is superior than my key. I am looking into the possibility to implement a padding scheme in order to fragment my plain text into small ones and then encrypt them. Is there any suggestion on how to the padding? Thanks in advance. 回答1: I'm sorry that I'm

Can I use elliptic curve cryptography as a password with Bouncy Castle in C#?

给你一囗甜甜゛ 提交于 2019-12-25 02:42:37
问题 I'd like to encrypt some data on a server so if someone got access to the database and codebase the secret data would not be compromised. It seems to me a good way to do this is through elliptic curve cryptography. I'm wondering how to do this in Bouncy Castle? I've Googled around and read some blog posts, but they generate keys unrelated to strings and I'm not sure how to implement it with a password, plus I don't want to make a mistake. essentially I'd like something like this: var

Python code that decrypts RSA encrypted file in chunks of 64 bit using a private exponent and modulus

China☆狼群 提交于 2019-12-24 17:04:41
问题 I have an encrypted file that I am trying to decode as part of an experiment. After working hard and long, I have been able to extract the private exponent from the public key since the modulus was small: openssl rsa -pubin -inform PEM -text -noout < public_key.pem Public-Key: (64 bit) Modulus: 16513720463601767803 (0xe52c8544a915157b) Exponent: 65537 Now, I have: Factors: 3917781347 x 4215069449 Private exponent: 9440767265896423601 Now, to derive the plaintext, I need to raise each 64-bit