rsa

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

杀马特。学长 韩版系。学妹 提交于 2020-04-30 04:28:27
问题 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

SHA256withRSA what does it do and in what order?

萝らか妹 提交于 2020-04-28 04:14:39
问题 I'm a total newbie when it comes to cryptography and such things. I don't (and dont want to) know the details of the SHA256 and RSA. I "know" what they do, not how they do it, and for now that's enough. I'm wondering what the "SHA256withRSA"-algorithm (if you can call it that) actually do and in what order. For example, does it hash the data with SHA256 and then encrypts it using RSA or is it vice-versa, or something else? The reason I'm asking is because I wanna do the java equivalent of:

SHA256withRSA what does it do and in what order?

ε祈祈猫儿з 提交于 2020-04-28 04:13:20
问题 I'm a total newbie when it comes to cryptography and such things. I don't (and dont want to) know the details of the SHA256 and RSA. I "know" what they do, not how they do it, and for now that's enough. I'm wondering what the "SHA256withRSA"-algorithm (if you can call it that) actually do and in what order. For example, does it hash the data with SHA256 and then encrypts it using RSA or is it vice-versa, or something else? The reason I'm asking is because I wanna do the java equivalent of:

RSA private key in secrets file in a centralized configurations

拈花ヽ惹草 提交于 2020-04-18 06:13:09
问题 I am creating an application where I am placing the RSA private key in application.yml to be read as a string. I want to put it in a secrets file and read it from a secret file where my all centralized configurations are available. My Requirement is, I want to read it from secret file as a string and not from .pem file In application.yml, generally how am I using the central config. logging: level: org: springframework: ${LOG_LEVEL:INFO} So we put the LOG_LEVEL=INFO in centralized config

Trouble loading RSA public key from file #2

我的未来我决定 提交于 2020-04-18 05:35:30
问题 Following Topaco's answer from previous post : Trouble loading RSA public key from file I've been reproducing the same using python : # Modulus, Exponent n = 0xC4F75716EC835D2325689F91FF85ED9BFC3211DB9C164F41852E264E569D2802008054A0EF459E7E3EABB87FAE576E735434D1D124B30B11BD6DE09814860155 e = 0x11 # Data to encrypt (m > n instead of m < n) buf = "c8cd2174b98433b93094b36026de125a7f5ed85ec27ee6bb9e996cb3b938e9c6238cc65d3615fb635f6f080f6dda06315928bcae4ccf802f9680547db57b8283" # convert buffer to

RunTime Error System.Security.Cryptography.CryptographicException: 'Bad Data. ' in vb.net when trying to import RSA parameters

↘锁芯ラ 提交于 2020-04-17 22:50:46
问题 Here's the code I am not sure if there's any hidden error but on runtime when trying to import the rsa parameters it pops up that error Function ModInverse(ByVal a As BigInteger, ByVal b As BigInteger) As BigInteger Dim b0 As BigInteger = b Dim t As BigInteger Dim q As BigInteger Dim x0 As BigInteger = 0 Dim x1 As BigInteger = 1 If b = 1 Then Return 1 While a > 1 q = BigInteger.Divide(a, b) t = b b = BigInteger.Remainder(a, b) a = t t = x0 x0 = BigInteger.Subtract(x1, BigInteger.Multiply(q,

RunTime Error System.Security.Cryptography.CryptographicException: 'Bad Data. ' in vb.net when trying to import RSA parameters

青春壹個敷衍的年華 提交于 2020-04-17 22:50:31
问题 Here's the code I am not sure if there's any hidden error but on runtime when trying to import the rsa parameters it pops up that error Function ModInverse(ByVal a As BigInteger, ByVal b As BigInteger) As BigInteger Dim b0 As BigInteger = b Dim t As BigInteger Dim q As BigInteger Dim x0 As BigInteger = 0 Dim x1 As BigInteger = 1 If b = 1 Then Return 1 While a > 1 q = BigInteger.Divide(a, b) t = b b = BigInteger.Remainder(a, b) a = t t = x0 x0 = BigInteger.Subtract(x1, BigInteger.Multiply(q,

Unknown characters at starting while parsing from private key in Asymmetric Algorithm

好久不见. 提交于 2020-04-17 20:37:09
问题 I am trying to implement asymmetric algorithm in Android. I have managed to do it all. But I am facing an issue while output. What I am getting after decrypting through private key is(Which contains actual text in the end): �������\�C���gz�{ܳkK��c��LB(7fz���H�8�� ��ȏ�ҍ�X ��KI��aj�B��x�D�n>�ι�& UL-1���E�;��s9�zB[�9B�t��B�A�s�GA6����y�f���J�����+. `g4�s�1��p�PW�%��7�"��fQ����G���x� �|&�ѡ�gq������:X�be�_��av��{'msg':'Laravel 7.7777777'} Actual message is : {'msg':'Laravel 7.7777777'} You can

Encryption in sending data from one app to another in android

喜你入骨 提交于 2020-04-16 02:27:23
问题 I want to send sensitive data from one app to another. I use Intent and send data via Bundle. Now, I am supposed to use an encryption algorithm to encrypt the data to send and parallelly the receiver app will decrypt the data. Which algorithm is best suited for the mobile platform? I have gone through RSA documents suggests that it is not suggested for long text encryption. I have seen the algorithm uses a random key generation method which will cause an issue in my case as both the app need

Java - Public-private key encryption - how to calculate private key in RSA

人走茶凉 提交于 2020-04-13 18:14:28
问题 I worked on a code for an RSA algorithm and it returns the incorrect number, which happens to be huge. I am sure I coded everything right except for one line I was not sure about. I did not know how to solve for the private key in the RSA, and just winged it (I saw someone code d = e.modInverse(m); where d is the private key, e is the public key, and m is (p-1)*(q-1). I dont understand how the modInverse method works though. long story short, how do you actually solve for the 'd' without