rsa

validating rsa signature from C# in java

╄→гoц情女王★ 提交于 2021-02-16 20:08:12
问题 I'm attempting to generate an RSA SHA512 signature on my server application (written in C#) and verify that signature on a client application (written in Java). Prior to the signature exchange, the server generates a public- and private-key pair and shares the public key with the client app by giving it the modulus and exponent values that were generated. The client app stores the values for later, when the signature needs to be verified. The server is generating a 128-byte modulus and a 128

Generate RSA key pair with WebCrypto in Chromium

时间秒杀一切 提交于 2021-02-10 14:48:35
问题 The following code works in Firefox 76.0.1: "use strict" let RSAKeys (async () => { RSAKeys = await crypto.subtle.generateKey({ name: "RSA-OAEP", modulusLength: 3072, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256"}, true, // Chromium bug causes it to falsely complain that the array is empty. Sometimes adding "encrypt" helps. ["wrapKey"]) })() but in Chromium 80 I get: Uncaught (in promise) DOMException: Usages cannot be empty when creating a key. ["wrapKey"] clearly isn't an empty

RSA Encryption function in Swift 4 from Public Key string

我怕爱的太早我们不能终老 提交于 2021-02-09 07:09:31
问题 My ultimate goal is to create a JWE string, given a public key for iOS. To make things easier for myself, I've broken down my steps so most pressingly, I need to create an encrypted key using RSA encryption from a secret key and public key string. I've tried a lot of things found here in stack overflow and other places of the internet. For various reasons they just haven't worked out. I am being guided by some Objective C code: /* Device Data encryption - create JWE given DS publicKey */ +

How to verify a JWT with RS256 signature in Deno?

送分小仙女□ 提交于 2021-02-08 10:12:09
问题 I want to verify a signature from a Google JWT which uses RS256 as signature algorithm as of right now (Certs from Google: https://www.googleapis.com/oauth2/v3/certs), and the only libary which i could find for Deno handles HS256 (https://deno.land/x/djwt). I am really not into the whole Cipher game, maybe anybody got an idea how i can verify the signature maybe there already is something with an example? I really don't know what i need to hash with SHA-256 or how i use RSA, when i try to

How to verify a JWT with RS256 signature in Deno?

半腔热情 提交于 2021-02-08 10:11:21
问题 I want to verify a signature from a Google JWT which uses RS256 as signature algorithm as of right now (Certs from Google: https://www.googleapis.com/oauth2/v3/certs), and the only libary which i could find for Deno handles HS256 (https://deno.land/x/djwt). I am really not into the whole Cipher game, maybe anybody got an idea how i can verify the signature maybe there already is something with an example? I really don't know what i need to hash with SHA-256 or how i use RSA, when i try to

RSA Encryption using aspnet_regiis

♀尐吖头ヾ 提交于 2021-02-08 09:15:51
问题 Hi I tried to encrypt my connectionString in webconfig using aspnet_regiis -pe "connectionStrings" -app "/MyApplication" I want to ask which key is used to encrypt my connection string, because here I ommited the provider parameter. Is there anyway to check it? Thanks before 回答1: to decrypt your web.config you just need to use aspnet_regiis again with -pd key: aspnet_regiis -pd connectionStrings -app /MyApplication 来源: https://stackoverflow.com/questions/36150555/rsa-encryption-using-aspnet

c# equivalent of “java.security.spec.RSAPublicKeySpec” and “java.security.PublicKey”

北城以北 提交于 2021-02-08 08:48:21
问题 I'm developing a new version in c# of an existing java application. The existing application uses RSA encryption with java.security.spec.* and boncycastle api. I'm looking for equivalent code in c# for the java below code: public static java.security.PublicKey getKey ( org.bouncycastle.asn1.x509.RSAPublicKeyStructure rsaPublicKey ) { java.security.KeyFactory keyFactory = KeyFactory.getInstance("RSA"); java.security.spec.RSAPublicKeySpec keySpec = new RSAPublicKeySpec( rsaPublicKey.getModulus(

Get the sha1-hashed value from XML signature value

寵の児 提交于 2021-02-07 10:50:30
问题 I need someone to help me understand XML digital signature method rsa-sha1 . I suppose the signature value = RSA-encrypt(sha1(signedInfo), privatekey). Note Base64.encode(sha1(signedInfo)) contains 28 characters. So I think Base64.encode(RSA-decrypt(signaturevalue), publickey) should return 28 characters as well. However, I actually got a 48-character string. Base64 base64 = new Base64(); byte[] encrypted = base64.decode(signatureValue); try { Cipher cipher = Cipher.getInstance("RSA"); cipher

Node.js correct way to make rsa encrypt?

╄→尐↘猪︶ㄣ 提交于 2021-02-07 09:44:56
问题 i'm trying to create a WS for make soap request. In the body of the message there is a field that contains an encrypted text. I have the public key to encrypt the text but the only result that i obtain is that the text is not recognized. I use crypto module of node for making request and the text is crypted but i don't know why is not correclty encrypted. Ps i made the same thing on php with openssl_public_encrypt function and working. But i have to do it in node.js. Any idea or suggestion?

Node.js correct way to make rsa encrypt?

爱⌒轻易说出口 提交于 2021-02-07 09:44:11
问题 i'm trying to create a WS for make soap request. In the body of the message there is a field that contains an encrypted text. I have the public key to encrypt the text but the only result that i obtain is that the text is not recognized. I use crypto module of node for making request and the text is crypted but i don't know why is not correclty encrypted. Ps i made the same thing on php with openssl_public_encrypt function and working. But i have to do it in node.js. Any idea or suggestion?