Questions tagged [digital-signature]

mathematical scheme for demonstrating the authenticity of a digital message or document (Wikipedia). A cryptographic toolkit is often used along with a public-private key pair to digitally sign a message and to verify a message.

Digital signatures are often used in a cryptographically secure message exchange to provide:

  • Authentication - proof that a message was sent from a trusted party
  • Integrity - proof that a message was not tampered with in transit
  • Non-repudiation - the receiver can proof to a third party that the message originated from the original sender

Message authentication codes (MAC) also offer authentication and integrity protection, but no non-repudiation.

Digital signatures generally make use of a public-private key pair. A private key is used to sign the message and a public key is used to verify the integrity and authenticity of a message.

If a message has been tampered with or was not signed by the expected party the verification of the signature will fail.

An example of digitally signing a simple message in java then verifying the result:

KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); 
KeyPair keyPair = kpg.generateKeyPair();

byte[] message = "My message is strong!".getBytes();

// Sign our message
Signature signer = Signature.getInstance("SHA1withRSA");
signer.initSign(keyPair.getPrivate());
signer.update(message);
byte[] signatureData = signer.sign();

// Verify our message using the public key + signatureData
Signature verifier = Signature.getInstance("SHA1withRSA");
verifier.initVerify(keyPair.getPublic());
verifier.update(message);

assertTrue(verifier.verify(signatureData));

See also:

3380 questions
1
vote
0 answers

ethereumjs - signature security issue

Im new to smart contracts world. I have a doubt about the digital signature security. I wanted to know if an attacker can reuse my same signed message and send it several times to another address? client code example: var msg = "hello"; var sh3 =…
Diagonal Think
  • 323
  • 1
  • 3
  • 14
1
vote
0 answers

Swift and Xcode Thread 1: signal SIGABRT error on YPDrawSignatureView

I try to use the YPDrawSignatureView for make an eSignature to my Swift 3.3 project with Xcode 9.3 version. First I pulled the YPDrawSignatureView.swift to my project. After I made two buttons and an UIImage to Main.storyboard. These objects pulled…
Johnny
  • 45
  • 8
1
vote
0 answers

Digital signature in Oracle APEX

I am developing an APEX 5 application where the user can upload/download his own files. I want the user to be able to digitally sign the files directly in the application by using his own USB token for digital signature. Is there a way I can do…
1
vote
3 answers

SAM PSO(Perform Security Operation):CDS(Compute digital signature) 6982 error

I'm trying to compute digital signature RSASSA-PSS with sha256 for my IdentityIdentificationData (ASN1). Directory file address 0x3D00 Aplication ID A000000061123A22738F4421 Private key folder 0x2F01 My ASN1 encoded hex data after sha256 encoded:…
BMErEr
  • 153
  • 13
1
vote
1 answer

Signature is Invalid for PDF File with iText

I am using swisscom digital signature service and we have a test account. Well the service requires the hash code the pdf file . We send it with DIGEST_VALUE=$(openssl dgst -binary -SHA256 $FILE | openssl enc -base64 -A) and I get a PKCS#7 response.…
ertan2002
  • 1,458
  • 1
  • 32
  • 68
1
vote
1 answer

Error calling CreateEnvelope : TAB_PAGE_NUMBER_NOT_SPECIFIED

I am a beginner in DocuSign API programming. I have a .cshtml page for create envelope for sending to customer. When I try to create envelop from DocuSign API it shows error message like: Page number not specified in tab element. Page Number or…
1
vote
2 answers

Put and extract text from ECDSA Signature

I am using secp256k1 to sign hash of a text in server and verify the signature on client side . Now, I need to send actual text as well to the client but my main constraint is bandwidth and I can't add text separately. Therefore, I need to be able…
Nil Null
  • 414
  • 5
  • 14
1
vote
1 answer

How to add overlay to already signed PDF without invalidating first signature using PDFBOX?

I am trying to add overlay (which i think is a disallowed change) to already signed PDF (visible detached signature) and then sign this PDF again. This results in invalidation of first signature. However, second signature remains valid. Is it…
Abhishek Dadhich
  • 321
  • 2
  • 10
1
vote
0 answers

How to access client side USB Token based Digital Signing Certificate in IIS

I have developed an MVC Application, which uses USB Token Digital Signature Certificate. When I run the application from Visual Studio, it works fine. But when I publish it on IIS it doesn't detect USB Token. Do I need to make changes/configuration…
1
vote
1 answer

PDF File size of 50kb increases dramatically up to 9mb after signing it with previously using Itext Java Application

I was a using a custom build itext based java application for digitally signing pdf files. Every thing was working fine for last one year but recently the size of the output signed pdf file drastically increasing up to 10 MB for just a 50kb source…
Lkbhai Lr
  • 264
  • 2
  • 11
1
vote
1 answer

Verify DSA Signature generated by Java in C#

I know this is a topic with lots of existing questions but I am failing to find any existing answers which cover my exact case. I need to sign a string (a URL) in some Java code and deliver the string along with the signature to a C# program. I run…
mchr
  • 6,161
  • 6
  • 52
  • 74
1
vote
0 answers

Combining two private keys to create an asymmetric digital signature

There is some algorithm which signs with a private key and verifies with a public key. Private and public keys are created in pairs. Assume we have 2 pairs of private and public keys. Is there a way to combine two private keys to one private key…
1
vote
2 answers

Check .NET Framework generated signature using .NET Core

I have some legacy .NET Framework code for signing and checking signatures which I need to port to .NET Core. This is the existing .NET Framework code: public static bool CheckSignature_NetFramework(string payload, string signature, string…
Robert Hegner
  • 9,014
  • 7
  • 62
  • 98
1
vote
0 answers

Getting Exception with USB key token while signing the data C#

Following is the code to sign the data. It works perfectly and signed when I run from Visual Studio but when I publish it to IIS it cannot match the certificate and no certificate gets assigned in mycert. Ultimately it throws the exception Cannot…
Ketan Kotak
  • 942
  • 10
  • 18
1
vote
0 answers

How to sign SHA256 hash and verify it using bouncy castle?

I'm trying to sign SHA256 hash of a base64 encoded json string and validate it against the signature generated. I'm using the below code to sign the hash: Required output: PKCS#7 signature of SHA-256 hash of Base64 of payload JSON using private…
VBC
  • 161
  • 1
  • 3
  • 15
1 2 3
99
100