digital-signature

Correct way to sign and verify signature using bouncycastle

南楼画角 提交于 2019-11-27 17:27:43
I am using bcmail-jdk16-1.46.jar and bcprov-jdk16-1.46.jar (Bouncycastle libraries) to sign a string and then verify the signature . This is my code to sign a string : package my.package; import java.io.FileInputStream; import java.security.Key; import java.security.KeyStore; import java.security.PrivateKey; import java.security.Security; import java.security.Signature; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import org.bouncycastle.cert.jcajce.JcaCertStore; import org.bouncycastle.cms.CMSProcessableByteArray; import org.bouncycastle.cms

Does anyone know a free(trial) timestamp server service? [closed]

♀尐吖头ヾ 提交于 2019-11-27 17:05:17
Would like to know if anybody knows any free(trial) time-stamp server service. I would like to test time stamping features in itext. Like I used Start Com class 1 as free CA for testing purposes. Hope I made it clear. Hoping someone knows a place Thanks jnm2 You can try one of these publicly accessible RFC 3161 compliant time-stamping services: https://freetsa.org Supports HTTP, HTTPS and TCP transports and has other features http://time.certum.pl http://dse200.ncipher.com/TSS/HttpTspServer http://tsa.safecreative.org 5 free requests per day (may not be valid as root CA is 'test') - Safe

Are breaches of JWT-based servers more damaging?

依然范特西╮ 提交于 2019-11-27 16:57:02
问题 UPDATE : I have concluded my research on this problem and posted a lengthy blog entry explaining my findings: The Unspoken Vulnerability of JWTs. I explain how the big push to use JWTs for local authentication is leaving out one crucial detail: that the signing key must be protected. I also explain that unless you're willing to go to great lengths to protect the keys, you're better off either delegating authentication via Oauth or using traditional session IDs. I have seen much discussion of

What does “Not LTV-enabled” mean?

南笙酒味 提交于 2019-11-27 16:25:12
问题 I'm using iText 5.5.3 to sign and timestamp PDF documents. It works very well. But I recently switched from Acrobat Pro X to XI and now I see this new line : the signature is not LTV enabled and will expire after <date> I guess this warns me that after this date, the signer's signature will be seen as invalid, right ? However the signature properties tells me : the signature includes an embedded timestamp : <date/time> signature was validated as of the secure timestamp time : <same date/time>

How to compute RSA-SHA1(sha1WithRSAEncryption) value with OpenSSL

蓝咒 提交于 2019-11-27 16:08:43
问题 I'm confused about RSA-SHA1, I thought it's RSA_private_encrypt(SHA1(message)). But I can't get the correct signature value. Is there anything wrong? 回答1: Yes, PKCS#1 encryption and PKCS#1 signatures are different. In the encryption case (the one you tried), the input message is simply padded before it is exponentiated. PKCS#1 signagtures on the other hand will first calculate an ASN.1 DER structure of the form DigestInfo ::= SEQUENCE { digestAlgorithm AlgorithmIdentifier, digest OCTET STRING

Loading raw 64-byte long ECDSA public key in Java

为君一笑 提交于 2019-11-27 14:26:32
I have a raw (r,s) format ECDSA NIST P-256 public key. It seems that there is no simple way to load it into an object that implements java.security.interfaces.ECPublicKey. What is the cleanest way to load a 64 byte public key so that it can be used to check signatures? This answer is going to be tough if we do this using ECPublicKeySpec . So lets cheat a bit: private static byte[] P256_HEAD = Base64.getDecoder().decode("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE"); public static ECPublicKey convertP256Key(byte[] w) throws InvalidKeySpecException { byte[] encodedKey = new byte[P256_HEAD.length + w

WinVerifyTrust to check for a specific signature?

冷暖自知 提交于 2019-11-27 14:06:06
I'm implementing a process elevation helper for Windows. It's a program that will run in elevated mode and launch other programs with administrator privileges without displaying additional UAC prompts. For security reasons, I want to make sure only binaries that are digitally signed with my company's Authenticode key can be executed. The WinVerifyTrust function gets me halfway there, but it only ensures that a binary is signed by some key that is part of Microsoft's chain of trust. Is there a relatively simple way to perform the Authenticode verification AND ensure that it is signed by our

How would an efficient OAuth2.0 server / provider work?

廉价感情. 提交于 2019-11-27 13:49:54
I may need to implement an OAuth2.0 server for an API I'm creating. This API would allow 3rd parties to perform actions on the user's behalf. OAuth2.0 has 3 mains calls. First, there is a call to prompt the user for consent. This returns a code . The second is where the code is exchanged for a access token . Finally, the access token is used to call the API on the user's behalf. For implementation, I was thinking the first call generates a random string which acts as a code . The code is then stored in a database with a pointer to the current User and a random HMAC Key , then the random data

How to add digital signature (RSA, Certificate, etc) to any of file, using PHP?

本秂侑毒 提交于 2019-11-27 12:33:41
问题 I need to know if any kind of file can be signed digitally, using RSA, a certificate, and that stuff, or if only certain kind of files can be signed. All this, using PHP. In example: Can a plain text file be signed digitally?, What about images (png, jpeg, bmp)? I don't need to "attach" an image with a graphic signature. Thank you for your help. 回答1: Using phpseclib, a pure PHP RSA implementation (updated here): <?php include('Crypt/RSA.php'); $rsa = new Crypt_RSA(); extract($rsa->createKey()

Insert digital signature into existing pdf file

喜你入骨 提交于 2019-11-27 12:14:15
I need to insert a digital signature into already existing pdf files, using a rails application server. (Basically, clients upload pdf files and the server signs them with a local certificate) I've been using JSignpdf to insert digital signatures into pdf files, and started probing for gems for ruby... I've found another portable file to do this job on rubypdf site http://soft.rubypdf.com/software/pdf-digital-signe , but cannot find any gem or even example code to do this in ruby. I've looked also at Digital signature verification with OpenSSL , but couldn't understand how to actually sign an