Categories
Mastering Development

Am I serializing a SealedObject wrong?

So for an Android project I need to write to and read from a NFC tag. My NFCReader code works just fine when I try to write and read plain text records. However, to make the system secure, I’m trying to seal my TagProfile object in a SealedObject with a Cipher, and then serialize that […]

Categories
Mastering Development

Encrypting a file data in Java to the same file

I’m developing a simple application that should accept a username and a password, the data is saved in a CSV file. I want this data to be encrypted so no one can simply open it and read the usernames and the passwords listed there, I dug down the web and found a good method that […]

Categories
Development

Amazon Pay Integration : Where can I get preSharedEncodedKey?

I’m trying to integrate Amazon Pay for receiving merchant payments and I see a method which receives preSharedEncodedKey. But I can’t find that key anywhere in document. Where can I find it? It is mentioned in [22 January 2019 Amazon Pay Integration Guide 26] private static byte[] encryptMerchantKey(final byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, BadPaddingException, […]

Categories
Development

RSA in Java and Python over RabbitMQ

I have a Java client and a Python server running RabbitMQ. I am securing the connection using RSA. Right now, the mechanism is quite simple: after exchanging the public keys, it just encrypts the messages on both sides using the public key of the destinatory. Later on, when this works, I could think of a […]

Categories
Development

How to replace the static keystore with a dynamic one for a spring-boot-application

I want to add/replace SSL certificates dynamically to my spring boot (tomcat) application without the need to restart it. I have a long way to go still, but currently I am stuck with a javax.crypto.BadPaddingException and don’t know why. So here is what I am trying to do. First, I am defining my own TomcatServletWebServerFactoryin […]

Categories
Development

Azure storage blob client side encryption does not decrypt Java

Azure storage blob, uploaded a blob using client-side encryption, using CEK and KEK. And now trying to download the decrypted file using the KEK on the client-side. But the file gets downloaded and does not decrypt. Shows only the encrypted file. public class KeyVaultGettingStarted { public static void main(String[] args) throws StorageException, NoSuchAlgorithmException, InterruptedException, ExecutionException, […]