How do digital signatures work
1. For example : data is sensitive like below:
{ "from": "James", "to" : "Bob" , "bankAccountNumber": 098759438583593, "transferTo" : 023759837463253, "value" : 1000, "ccy" : "USD" }
The problem is that if I want to transfer this data from VietComBank to TechComBank to make a transaction between James and Bob
If this data is transferred as raw data, it means that the middle man could edit the data and continue transfer the edited data to the destination
Look at this flow: VietComBank ---> Middle man ---> TechComBank
I suppose that if the middle man edited transferTo and to to another bank account of hacker
If this happens that is so terrible.
So Software engineers were born to fix this problem. They will give the VietComBank a private key and TechComBank a public key
VietComBank before sending the sensitive data, they need to hash the data to generate hashed data --> after that they need to encrypt the hashed data with private key to generate a signature digital.
For example:
{ data: { "from": "James", "to" : "Bob" , "bankAccountNumber": 098759438583593, "transferTo" : 023759837463253, "value" : 1000, "ccy" : "USD" }, signature_digital: "uhf37hqjhas73hharw76q8uwrqwjh342g" }They need to transfer both the data and the signature in one request to TechComBank
P/S: You can use RSA algorithm
https://www.novixys.com/blog/how-to-generate-rsa-keys-java/
The solution is great.
Comments
Post a Comment