Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Version 1.4.9 - 2026-06-09
* fix: use random nonce per call in AES-GCM onboarding signature

## Version 1.4.8 - 2024-10-23
* Added support for fetch methods on payments

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.razorpay</groupId>
<artifactId>razorpay-java</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.razorpay</groupId>
<artifactId>razorpay-java</artifactId>
<version>1.4.8</version>
<version>1.4.9</version>
<packaging>jar</packaging>

<name>razorpay-java</name>
Expand Down
8 changes: 5 additions & 3 deletions src/test/java/com/razorpay/UtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ public static String decrypt(byte[] encryptedData, String secret) throws Excepti
byte[] keyBytes = secret.substring(0, 16).getBytes(StandardCharsets.UTF_8);
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
byte[] iv = new byte[12];
System.arraycopy(keyBytes, 0, iv, 0, 12);
System.arraycopy(encryptedData, 0, iv, 0, 12);
byte[] ciphertext = new byte[encryptedData.length - 12];
System.arraycopy(encryptedData, 12, ciphertext, 0, ciphertext.length);
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
GCMParameterSpec gcmSpec = new GCMParameterSpec(128, iv);
cipher.init(Cipher.ENCRYPT_MODE, keySpec, gcmSpec);
byte[] decryptedBytes = cipher.doFinal(encryptedData);
cipher.init(Cipher.DECRYPT_MODE, keySpec, gcmSpec);
byte[] decryptedBytes = cipher.doFinal(ciphertext);
return new String(decryptedBytes);
}

Expand Down
Loading