bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

gost89 not implementation

Open maxben14 opened this issue 3 years ago • 0 comments

I try do this: `Security.addProvider(new BouncyCastleProvider());

	key = new SecretKeySpec(keyBytes, "GOST28147");

	in = Cipher.getInstance("GOST28147/CFB8/NoPadding", "BC");`

In gradle: implementation 'org.bouncycastle:bcprov-jdk15on:1.62'

But i have exception. Help me please, how fix this error ? 10-04 11:50:29.119 5979-5979/com.example.myproc W/System.err: java.security.NoSuchAlgorithmException: GOST28147/CFB8/NoPadding 10-04 11:50:29.123 5979-5979/com.example.myproc W/System.err: at javax.crypto.Cipher.getCipher(Cipher.java:296) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at javax.crypto.Cipher.getInstance(Cipher.java:237) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at javax.crypto.Cipher.getInstance(Cipher.java:210) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at com.example.myproc.MainActivity.testCFB(MainActivity.java:296) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at com.example.myproc.MainActivity.onCreate(MainActivity.java:2071) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.Activity.performCreate(Activity.java:5231) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.ActivityThread.access$800(ActivityThread.java:135) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.os.Looper.loop(Looper.java:136) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5001) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at java.lang.reflect.Method.invoke(Method.java:515) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at dalvik.system.NativeStart.main(Native Method) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: Caused by: java.security.NoSuchAlgorithmException: Cipher GOST28147 implementation not found 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:170) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: at javax.crypto.Cipher.getCipher(Cipher.java:291) 10-04 11:50:29.127 5979-5979/com.example.myproc W/System.err: ... 18 more

maxben14 avatar Oct 04 '20 15:10 maxben14