all are in classes, tried and caught ... when decrypting the the sent string with private key ..i get the error "javax.crypto.BadPaddingException: Data must start with zero"
I have tried this in a seprate file from my work and all results are fine....
below is the test script that works fine.... any ideas ? ( i know not all imports are used in test code )
Claude on Windows is eating up massive amounts of RAM, with no way to stop it by Usama Jawad
Anthropic has been in the headlines a lot lately, primarily due to its latest revenue and valuation figures, along with its release of its state-of-the-art (SOTA) Fable model. While its flagship product, Claude, may be very popular among millions of users, a lot of them are now reporting memory issues when using the tool.
Over on Claude Code's GitHub repository, an issue raised in February has been gaining traction once again. Basically, Claude Desktop on Windows spins up a 1.8GB Hyper-V virtual machine if you use Claude Cowork or agent mode even once. This happens on each launch of Claude Code even if you plan to use the tool in chat mode only.
Several users have upvoted this bug and stated that it's happening on their machine as well. However, it seemingly affects only Claude desktop users on Windows, not customers of the CLI or any other platform. Once the bug is triggered, it also shows a Vmmem process in Task Manager, indicating CPU usage of 0% and RAM utilization of a whopping ~1.8GB.
Claude users complain that this process should only spin up when you explicitly launch agent mode or Cowork in Claude, with session files efficiently cleaned up after use. Additionally, they are calling for Claude to gracefully handle the absence of virtual machine-based infrastructure, without compromising on chat performance.
It's unclear when this issue originated or what the root cause behind it is, but people are once again actively engaging in the GitHub thread as well as Hacker News. You can also find other technical details and log events over on GitHub.
It's unclear if Anthropic will look into this issue, especially since it's already been reported for a few months. However, the bug is also causing major annoyance for users, with many claiming that it has led them to uninstall Claude Code on desktop, as a concrete workaround is not yet known.
Question
Original Poster
i am having issues with decrypting sent messages .... here is the encryption code from person A ...
and here is the [b]decryption [/b]code from person B
byte[] src = inputLine.getBytes();
System.out.println(src);
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, jim);
byte[] cipherData = cipher.doFinal(src);
System.out.println("Decrypted: " + new String(cipherData));
[/CODE]
all are in classes, tried and caught ... when decrypting the the sent string with private key ..i get the error "javax.crypto.BadPaddingException: Data must start with zero"
I have tried this in a seprate file from my work and all results are fine....
below is the test script that works fine.... any ideas ? ( i know not all imports are used in test code )
import java.awt.*;
import java.awt.RenderingHints.Key;
import java.net.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.*;
import java.util.UUID;
public class test
{
public static void main(String arg[]) {
KeyPairGenerator kpg;
try {
kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(2048);
KeyPair kp = kpg.genKeyPair();
PublicKey publicKey = kp.getPublic();
PrivateKey privateKey = kp.getPrivate();
KeyFactory fact = KeyFactory.getInstance("RSA");
RSAPublicKeySpec pub = fact.getKeySpec(kp.getPublic(),
RSAPublicKeySpec.class);
RSAPrivateKeySpec priv = fact.getKeySpec(kp.getPrivate(),
RSAPrivateKeySpec.class);
String bob = "hi";
byte[] src = bob.getBytes();
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
byte[] cipherData = cipher.doFinal(src);
System.out.println(new String(cipherData));
Cipher cipher1 = Cipher.getInstance("RSA");
cipher1.init(Cipher.DECRYPT_MODE, privateKey);
byte[] cipherData1 = cipher1.doFinal(cipherData);
System.out.println(new String(cipherData1));
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvalidKeySpecException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchPaddingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvalidKeyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BadPaddingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
[/CODE]
Link to comment
https://www.neowin.net/forum/topic/1122108-latest-problem-with-rsa-encryption/Share on other sites
1 answer to this question
Recommended Posts