diff --git a/ChangeLog.md b/ChangeLog.md
index ddc53f68..7199735e 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,5 @@
+* [0.2.11](https://github.com/mwiede/jsch/releases/tag/jsch-0.2.11)
+ * [#369](https://github.com/mwiede/jsch/issues/369) fix multi-line PEM key parsing to work with windows line endings due to regression from previous fix for [#362](https://github.com/mwiede/jsch/issues/362).
* [0.2.10](https://github.com/mwiede/jsch/releases/tag/jsch-0.2.10)
* Fix new Java 21 compiler warning: `possible 'this' escape before subclass is fully initialized`.
* Tweak OSGi bundle manifest to allow Log4j 3.
diff --git a/pom.xml b/pom.xml
index f496cff3..0133c58e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
org.bouncycastle
bcprov-jdk18on
- 1.75
+ 1.76
true
@@ -405,7 +405,7 @@
0)
- data = Util.fromBase64(_buf, start, i - xds - start);
+ if (i - (xds ? 1 : 0) - start > 0)
+ data = Util.fromBase64(_buf, start, i - (xds ? 1 : 0) - start);
Util.bzero(_buf);
}
diff --git a/src/main/java/com/jcraft/jsch/bc/CAST128CBC.java b/src/main/java/com/jcraft/jsch/bc/CAST128CBC.java
index d3b6c933..62071aaa 100644
--- a/src/main/java/com/jcraft/jsch/bc/CAST128CBC.java
+++ b/src/main/java/com/jcraft/jsch/bc/CAST128CBC.java
@@ -28,9 +28,11 @@
import com.jcraft.jsch.Cipher;
import org.bouncycastle.crypto.BufferedBlockCipher;
+import org.bouncycastle.crypto.DefaultBufferedBlockCipher;
import org.bouncycastle.crypto.engines.CAST5Engine;
import org.bouncycastle.crypto.modes.CBCBlockCipher;
-import org.bouncycastle.crypto.params.*;
+import org.bouncycastle.crypto.params.KeyParameter;
+import org.bouncycastle.crypto.params.ParametersWithIV;
public class CAST128CBC implements Cipher {
private static final int ivsize = 8;
@@ -64,7 +66,7 @@ public void init(int mode, byte[] key, byte[] iv) throws Exception {
try {
ParametersWithIV keyspec =
new ParametersWithIV(new KeyParameter(key, 0, key.length), iv, 0, iv.length);
- cipher = new BufferedBlockCipher(new CBCBlockCipher(new CAST5Engine()));
+ cipher = new DefaultBufferedBlockCipher(CBCBlockCipher.newInstance(new CAST5Engine()));
cipher.init(mode == ENCRYPT_MODE, keyspec);
} catch (Exception e) {
cipher = null;
diff --git a/src/main/java/com/jcraft/jsch/bc/CAST128CTR.java b/src/main/java/com/jcraft/jsch/bc/CAST128CTR.java
index 986858dd..f1821012 100644
--- a/src/main/java/com/jcraft/jsch/bc/CAST128CTR.java
+++ b/src/main/java/com/jcraft/jsch/bc/CAST128CTR.java
@@ -28,13 +28,15 @@
import com.jcraft.jsch.Cipher;
import org.bouncycastle.crypto.engines.CAST5Engine;
+import org.bouncycastle.crypto.modes.CTRModeCipher;
import org.bouncycastle.crypto.modes.SICBlockCipher;
-import org.bouncycastle.crypto.params.*;
+import org.bouncycastle.crypto.params.KeyParameter;
+import org.bouncycastle.crypto.params.ParametersWithIV;
public class CAST128CTR implements Cipher {
private static final int ivsize = 8;
private static final int bsize = 16;
- private SICBlockCipher cipher;
+ private CTRModeCipher cipher;
@Override
public int getIVSize() {
@@ -63,7 +65,7 @@ public void init(int mode, byte[] key, byte[] iv) throws Exception {
try {
ParametersWithIV keyspec =
new ParametersWithIV(new KeyParameter(key, 0, key.length), iv, 0, iv.length);
- cipher = new SICBlockCipher(new CAST5Engine());
+ cipher = SICBlockCipher.newInstance(new CAST5Engine());
cipher.init(mode == ENCRYPT_MODE, keyspec);
} catch (Exception e) {
cipher = null;
diff --git a/src/main/java/com/jcraft/jsch/bc/SEEDCBC.java b/src/main/java/com/jcraft/jsch/bc/SEEDCBC.java
index dd032fde..3c9d2d4c 100644
--- a/src/main/java/com/jcraft/jsch/bc/SEEDCBC.java
+++ b/src/main/java/com/jcraft/jsch/bc/SEEDCBC.java
@@ -28,9 +28,11 @@
import com.jcraft.jsch.Cipher;
import org.bouncycastle.crypto.BufferedBlockCipher;
+import org.bouncycastle.crypto.DefaultBufferedBlockCipher;
import org.bouncycastle.crypto.engines.SEEDEngine;
import org.bouncycastle.crypto.modes.CBCBlockCipher;
-import org.bouncycastle.crypto.params.*;
+import org.bouncycastle.crypto.params.KeyParameter;
+import org.bouncycastle.crypto.params.ParametersWithIV;
public class SEEDCBC implements Cipher {
private static final int ivsize = 16;
@@ -64,7 +66,7 @@ public void init(int mode, byte[] key, byte[] iv) throws Exception {
try {
ParametersWithIV keyspec =
new ParametersWithIV(new KeyParameter(key, 0, key.length), iv, 0, iv.length);
- cipher = new BufferedBlockCipher(new CBCBlockCipher(new SEEDEngine()));
+ cipher = new DefaultBufferedBlockCipher(CBCBlockCipher.newInstance(new SEEDEngine()));
cipher.init(mode == ENCRYPT_MODE, keyspec);
} catch (Exception e) {
cipher = null;
diff --git a/src/main/java/com/jcraft/jsch/bc/TwofishCBC.java b/src/main/java/com/jcraft/jsch/bc/TwofishCBC.java
index 716de0a5..2a875497 100644
--- a/src/main/java/com/jcraft/jsch/bc/TwofishCBC.java
+++ b/src/main/java/com/jcraft/jsch/bc/TwofishCBC.java
@@ -28,9 +28,11 @@
import com.jcraft.jsch.Cipher;
import org.bouncycastle.crypto.BufferedBlockCipher;
+import org.bouncycastle.crypto.DefaultBufferedBlockCipher;
import org.bouncycastle.crypto.engines.TwofishEngine;
import org.bouncycastle.crypto.modes.CBCBlockCipher;
-import org.bouncycastle.crypto.params.*;
+import org.bouncycastle.crypto.params.KeyParameter;
+import org.bouncycastle.crypto.params.ParametersWithIV;
abstract class TwofishCBC implements Cipher {
private static final int ivsize = 16;
@@ -59,7 +61,7 @@ public void init(int mode, byte[] key, byte[] iv) throws Exception {
try {
ParametersWithIV keyspec =
new ParametersWithIV(new KeyParameter(key, 0, key.length), iv, 0, iv.length);
- cipher = new BufferedBlockCipher(new CBCBlockCipher(new TwofishEngine()));
+ cipher = new DefaultBufferedBlockCipher(CBCBlockCipher.newInstance(new TwofishEngine()));
cipher.init(mode == ENCRYPT_MODE, keyspec);
} catch (Exception e) {
cipher = null;
diff --git a/src/main/java/com/jcraft/jsch/bc/TwofishCTR.java b/src/main/java/com/jcraft/jsch/bc/TwofishCTR.java
index e86c7285..ab6ad230 100644
--- a/src/main/java/com/jcraft/jsch/bc/TwofishCTR.java
+++ b/src/main/java/com/jcraft/jsch/bc/TwofishCTR.java
@@ -28,12 +28,14 @@
import com.jcraft.jsch.Cipher;
import org.bouncycastle.crypto.engines.TwofishEngine;
+import org.bouncycastle.crypto.modes.CTRModeCipher;
import org.bouncycastle.crypto.modes.SICBlockCipher;
-import org.bouncycastle.crypto.params.*;
+import org.bouncycastle.crypto.params.KeyParameter;
+import org.bouncycastle.crypto.params.ParametersWithIV;
abstract class TwofishCTR implements Cipher {
private static final int ivsize = 16;
- private SICBlockCipher cipher;
+ private CTRModeCipher cipher;
@Override
public int getIVSize() {
@@ -58,7 +60,7 @@ public void init(int mode, byte[] key, byte[] iv) throws Exception {
try {
ParametersWithIV keyspec =
new ParametersWithIV(new KeyParameter(key, 0, key.length), iv, 0, iv.length);
- cipher = new SICBlockCipher(new TwofishEngine());
+ cipher = SICBlockCipher.newInstance(new TwofishEngine());
cipher.init(mode == ENCRYPT_MODE, keyspec);
} catch (Exception e) {
cipher = null;
diff --git a/src/test/java/com/jcraft/jsch/KeyPairTest.java b/src/test/java/com/jcraft/jsch/KeyPairTest.java
index 066382db..f8b007e7 100644
--- a/src/test/java/com/jcraft/jsch/KeyPairTest.java
+++ b/src/test/java/com/jcraft/jsch/KeyPairTest.java
@@ -37,6 +37,10 @@ static Stream keyArgs() {
Arguments.of("encrypted_openssh_private_key_dsa", "secret123", "ssh-dss"),
// unencrypted RSA with windows (\r\n) line endings
Arguments.of("issue362_rsa", null, "ssh-rsa"),
+ Arguments.of("issue_369_rsa_opensshv1", null, "ssh-rsa"),
+ Arguments.of("issue_369_rsa_pem", null, "ssh-rsa"),
+ Arguments.of("encrypted_issue_369_rsa_opensshv1", "secret123", "ssh-rsa"),
+ Arguments.of("encrypted_issue_369_rsa_pem", "secret123", "ssh-rsa"),
// ecdsa EC private key format
Arguments.of("docker/id_ecdsa256", null, "ecdsa-sha2-nistp256"), //
Arguments.of("docker/id_ecdsa384", null, "ecdsa-sha2-nistp384"), //
diff --git a/src/test/resources/docker/authorized_keys.KeyPairIT b/src/test/resources/docker/authorized_keys.KeyPairIT
index ac83da75..555a29d4 100644
--- a/src/test/resources/docker/authorized_keys.KeyPairIT
+++ b/src/test/resources/docker/authorized_keys.KeyPairIT
@@ -6,6 +6,10 @@ ssh-dss AAAAB3NzaC1kc3MAAACBAKCQzxCEIM7yb5fbSmuJCz/+v40WEbULx4JKCXBb7zmRtDtweBqU
ssh-dss AAAAB3NzaC1kc3MAAACBAMKmaZwslPWE83wv+Ofl9oaMeOR03Yk0cyDc5fSAgjepXZQR5sps0KFORRufI6dLQHY4XLoyPc/Hr0ra+vY/l+p20cJVjQ07oosPU/d2eLdZ66rdjXCyrJPjFjnNJtumnBnJZqWGObKspnWk73vPOflReyGpUFe51PF1usur3uDLAAAAFQC3dSlxZZVNbvqjJpg8/oSMuG27/QAAAIEApkd3miYVc/Cl1QwdqwInIjby1yGNCfFsZALGBYc67lkd5lGBdNlL+fgi+BwC6UXu5OAqWB/b9OtvJR8NRcM77V252IER4t95t2ZdG66M1T5q1aOVL/ehPZFHf0oPXHJLcsybzqKFAtQj5hEbnrwJYW0fWi87C9LApplzPTVYQikAAACAUEu5tFmImzyQsUBMN/j1GWCCSVznjfRHkeGwx5koC0D2iK3mMphnF9avsoX2PrboEbGqy69JPCekKQiPPWxcQRTRqFS/ySkECJ5lJ2zJrW1whjLQEJbOq7WmusSML9UXCpNSwCqhJxPYx5a8Pq7lrrBP21jT/Z/A4m4c4wMkLXo= test
ssh-dss AAAAB3NzaC1kc3MAAACBAPmIBCP1AA8EiTL0VAdzau+1KuRmPkg+H2du4zt4ifhzEx4MscZ7cpBsUAM/EBC/ECWTHzDiWyFFuenvxDlfTi9XxySdOKM6XGLkY7oLsY1y5bShyLrycxDD7MRQ8HpUc9TPzE2PDH4Od6o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QAAAAIbmlzdHAzODQAAABhBPKyvhX/3Q32EEhZKF6s+fEzfQwabsSpXgFJ2LwpGxKFxzE2jw4Nvwe9W3YbPyrZU6K2MMA7p7ZdJwdDP/tQ9dhttOGGSkea9Cq4dcdgC9cdBuQ4aGb8crmY3Z5wc1dPxQ== test
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAG3XTlAFoQd4iIBt5KoTHJk46v1AdZSd+wfCSpc2/GCzHNGVqidrKCrypszpkQOW6vYG8riilyfF36rJa9ipjR+5gDApLIe/ix1Fknr8MU6nWoYv2+NBTsEcaS/VTeiUuMKftMtlO2wOaWFcbZBQUAlb3LDnpMyYKCqIXhhl4vqCxBukg== test
diff --git a/src/test/resources/encrypted_issue_369_rsa_opensshv1 b/src/test/resources/encrypted_issue_369_rsa_opensshv1
new file mode 100644
index 00000000..bb9a2709
--- /dev/null
+++ b/src/test/resources/encrypted_issue_369_rsa_opensshv1
@@ -0,0 +1,39 @@
+-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABCd+5LZfU
+vM8no5y5XUnD99AAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQC96PvllVEO
+gtQdHnaoga3gi8md+/lUwBG0SOv4co9QaJ2kvJZDTiSLmJc4euEuciiplvzKpKSWSVqaZL
+boXiVVt8MnPmIwIlp8bhIqJ+0431FNWWq6RA/4EszHiARxMIwUqw+svN2GMm5fGr+PK3FR
+6mXGjiVlv4/5Vb0BCUjgB0vIqq123DmKpxrT6S3Ik5vYCCn0zKtuWxfxp3hpCqC2TdqD7/
+rFTX/AstmlhTO4FRDEK/7JNBSWY8+9/rQS/c/HSSW7qMGEoGFkELKSYFSdwLcyAMS1HySz
+NR1SuyBLDsOSaN5iWm5cBqKIK175Uc3Xe3fIn6+C5ld0m/nN75bw6QJiD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src/test/resources/encrypted_issue_369_rsa_opensshv1.pub b/src/test/resources/encrypted_issue_369_rsa_opensshv1.pub
new file mode 100644
index 00000000..2ba237d7
--- /dev/null
+++ b/src/test/resources/encrypted_issue_369_rsa_opensshv1.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC96PvllVEOgtQdHnaoga3gi8md+/lUwBG0SOv4co9QaJ2kvJZDTiSLmJc4euEuciiplvzKpKSWSVqaZLboXiVVt8MnPmIwIlp8bhIqJ+0431FNWWq6RA/4EszHiARxMIwUqw+svN2GMm5fGr+PK3FR6mXGjiVlv4/5Vb0BCUjgB0vIqq123DmKpxrT6S3Ik5vYCCn0zKtuWxfxp3hpCqC2TdqD7/rFTX/AstmlhTO4FRDEK/7JNBSWY8+9/rQS/c/HSSW7qMGEoGFkELKSYFSdwLcyAMS1HySzNR1SuyBLDsOSaN5iWm5cBqKIK175Uc3Xe3fIn6+C5ld0m/nN75bw6QJiDH7I2jMYDTBpDqztBiqdjcSwvNTogGQg/oJLC7aAz+E5gfkTsg/Q6bPf6quyPIQ+KKH5v2YVFQIw2Te0X7/OZACsqUnCbGiDXCixPTTGoRypcR0MQDJxR497y7zvO4kiqQpsdBoELuhWSW8+9BcovL4/jSyqUEGvGYoh/QM= test
diff --git a/src/test/resources/encrypted_issue_369_rsa_pem b/src/test/resources/encrypted_issue_369_rsa_pem
new file mode 100644
index 00000000..b6469663
--- /dev/null
+++ b/src/test/resources/encrypted_issue_369_rsa_pem
@@ -0,0 +1,42 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,D5AFEF41BADEB0A6ADDCC294C4C34402
+
+BgIiIqe5ABrapndv+KDz2EoUj/QWtEJ81cCVLBJT05GTA93ZPYmwFOOHzwDtZN2n
+36qqSkiytcPcF4onogR50qziz/k3cN38Eiiqyrm1kOrIkxaCUogy0I2vQvDSYr8v
+CuW7btHpHpv8TlbWWNO2O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aVuIIo7cnqkDGXjnVTtganrRfdS0YzUh7jkoxN0us9YBMKyJnNNIDMEJW5SOU2i
+t2qluYBIdfEdvB/LWOgJt0YDQUtk0ed7RCQqauBKDPWLvZ+Q8j4DOdZgW8makCS1
+-----END RSA PRIVATE KEY-----
diff --git a/src/test/resources/encrypted_issue_369_rsa_pem.pub b/src/test/resources/encrypted_issue_369_rsa_pem.pub
new file mode 100644
index 00000000..92c85d94
--- /dev/null
+++ b/src/test/resources/encrypted_issue_369_rsa_pem.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqGObM6DyGcra+/eBdm7mIvnLM9oUDUwpT3hRbF7S7V6bb64EuFlduGXJKK+i4/a/ls1Sm3GVwnWvwuRxrVXgv1497MYDzDcflfm+bQLUN38qNscVhn3jdtFuCTIc7VKmtEd9zn4HVzQhUYWq/oiqwOsDeP1QidWbNwgBthCxzhfdi9XUpdpT3Tm/mtLwEz8KZ2kP9VdfXBql6NI64COcI+B2nzE2YwxZsLGFj1orstRZ3WOLTJdLtQ1NhBQqTEwFD06Jhf50wo13xV84jWeZom+ylJQcj9njnfH8Kf7T+1eyBAqCPLvS6kM5Q9J6bGPj67Hkp96zPT/y3Gh1le80o3JrYjo20NqWzO+/OIXilrDoYdUKJbgoM7GXtMlxFNEnj7BIf6TLNZJY9bA6dw1yFs9wOl9LRhC1zUC6kESx8DIiqSpxrZTF0ScgvC/gKqX6K81ovJBklrAuTQpTqGKOW2eY5jqiRAVa7Gx8sPPtHkGqodD/sFOKurggVDf2Y1vs= test
diff --git a/src/test/resources/issue_369_rsa_opensshv1 b/src/test/resources/issue_369_rsa_opensshv1
new file mode 100644
index 00000000..2422781e
--- /dev/null
+++ b/src/test/resources/issue_369_rsa_opensshv1
@@ -0,0 +1,39 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIG4gIBAAKCAYEA9bm+MifEwl4D2k7QEhANN+CvvOc6NjA5UQge7R4KZiKSu27T
+8Ys2BDx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Wl09qR/f1r6ZQOg2Ew
+HiUnsFq8XxAwvQ7SrrLvGY7OAxp4mSeUufP/uP9hNIZQoXof6gxosLxeTfDq4ddA
+dWQCygbX8PQRrrg7BMqC1pRIGljwt7ijKy2H4RS8WteGlM+nTrps9iEImAqxoOAz
+ky2V56s1enP1E+5C/1Hr6yyVSxBF46482Bpl2WvJG6BBQRV146E=
+-----END RSA PRIVATE KEY-----
diff --git a/src/test/resources/issue_369_rsa_opensshv1.pub b/src/test/resources/issue_369_rsa_opensshv1.pub
new file mode 100644
index 00000000..f85c3b06
--- /dev/null
+++ b/src/test/resources/issue_369_rsa_opensshv1.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD1ub4yJ8TCXgPaTtASEA034K+85zo2MDlRCB7tHgpmIpK7btPxizYEPEPywVnBRGMJnhIyKKHc7AHzCos3tkGVYNBlDGmnoaZTeZqhmsRSqqxHyfIRQ1T+aGIN4scliZ+iW8RI/djYyfPlcAR3Kku+Q3xsR5K2yzzxZiYB/rD9XjvRRtc7cYZlHaMe2NBtQhh3hamQVSEJMjfSCpq4okULk0UytXhdbPtP/tLDvqeK7op+q97hFS0wRY9xTaNM+qUhuhaKNbhuexgGQBk7We45LcR6O3XwjAB+X7owa4JtKx9oKY93+3qtM+5+6nRnFnkB/GL5fdKPmIswQ1vOSgGeEhg/M0yzX0PEMx4qfczpUp2rFtMTNg9O6Xz9qJCnZy/I1EmK6FEXerpEY0x41mY2NBBor9vataM9IxzJ1VIra8JYjnPqG48V9LFhSEpFfi1CquqJu1fmtxtH4YNWWNQECKp0s+WmxKAu2ZAAr1wl+tNkkiZOaDSluT14qMkSEjU= test
diff --git a/src/test/resources/issue_369_rsa_pem b/src/test/resources/issue_369_rsa_pem
new file mode 100644
index 00000000..bdd875ba
--- /dev/null
+++ b/src/test/resources/issue_369_rsa_pem
@@ -0,0 +1,39 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIG5AIBAAKCAYEAs3v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+qZ5sL
+bb+AVsIPOhS1Nk64QyXru6Bz0M6doY3pgZJRGmXPwqfpHFsVGrjFoYU0Xxz4zWJb
+fY0UBJZfb2vgLcHGVYCUL6C6d+f0m6DFDB7iqY06hU7EirYzA6iAcKiIHgAbELB2
+7ux+jieXxWKaMsJWYgR7XQn/UbC5xuOPSazZ5ws3Hz8toUK1tsYjXe+RoZioij2f
+Xm+9NXEFFGhLtOvepf9qw1fHlIIetCOJ/yrCJKVzFmzhUReGPAnmoA==
+-----END RSA PRIVATE KEY-----
diff --git a/src/test/resources/issue_369_rsa_pem.pub b/src/test/resources/issue_369_rsa_pem.pub
new file mode 100644
index 00000000..2178b42d
--- /dev/null
+++ b/src/test/resources/issue_369_rsa_pem.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCze/5G1FPKvgcnLXqHV4jbUfO+gi75BUKUWKBowdg63kr9e3GdGVmwtBBWTJMyxEWVtJMrH8CARWoyViILQy9oFfbbcwuAnfhVjdPVNpK7RL1ZwCCrsg6UDpE+Vp4rTWzUcDXUyI2MZrePJCwU0+UWdvoEJXwE2Nitb+sS802IsdlwiRj9knzKJ5rVcpGpQ0Qkc0jbeNDfznRAE8ARawkDLcXEio9V6t4psAWf3BbHGYec9PZAYcdzCHcwmLmTT/DSOF+ut2fxvjBydWJzGHmKyozlFNjThgXt0i0fcedLG0oAHNNBL8UeEYQ7H0glbT9rsnMqOAtgBYD/nJGfMkMMjP7NRS0Y0jtkmY8PQ3l7RkHTFeKVkKpKtyD3+LsfuOZkh5A6rhOZgMP9+22AZhIXGho9kJZSSF7B9CWa+TCr5iZo9lLXbeMFRrk5Ltg7BNHkO5Rx8SGroGYGkLXt89+eL+Ht1I4jbq1fWF55YQYnTOovvnNVVCp4i0c8KlNAqSM= test