Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, Java begginer class. I wonder if anyone can help me see my error in the code

ID: 3700794 • Letter: H

Question

Hi,
Java begginer class.
I wonder if anyone can help me see my error in the code?

Chat Encrypt/Decrypt.

04-05 03:29:33.786 4448-4484/com.positiveid.mobilechatrevised D/MyRecMsg: FetchPostsTask AsyncTask 04-05 03:29:33.787 4448-4484/con.positive?d.mobilechatrevised D/MyRecMsg : url = http ./testchat . ri ewater.net/ e ostaandroid 04-05 03:29:33.787 4448-4484/com.positiveid.mobilechatrevised D/NetworkSecurityConfig: No Network Security Config specified, using platform default 04-05 03:29:33.851 4448-4484/com.positiveid.mobilechatrevised D/MyRecMsg: Connection was made 04-05 03:29:34.023 4448-4484/com.positiveid.mobilechatrevised D/MyMg: In exception javax.crypto.IllegalBlocksizeException: last block incomplete in decryption In exception Javax.crypto.IllegalBlocksizeException: last block incomplete in decryption 04-05 03:29:34.024 4448-4484/com.positiveid.mobilechatrevised D/MyMag: In exception Javax.crypto. Iilega1BlocksizeException: last block incomplete in decryption 04-05 03:29:34.029 4448-4484/com.positiveid.mobilechatrevised D/MyMsg: In exception javax.crypto.Illegal1Block5izeException: last block incomplete in decryption 04-05 04-05 03:29:34.030 03:29:34.035 4448-4484/com.positiveid.mobilechatrevised D/MyRecMsg; Connection ?? closed 4448-4484/com . positive id.mobilechatrevised E/AndroidRuntime ; FATAL EXCEPTION; AsyncTask #1 Process: com.positiveid.nobilechatrevised, PID: 4448 java.lang.RuntineException: An error occurred while executing doInBackground () at android.os.Asynclask 3.done ( at java.util.concurrent.FutureTask.finishCorpletion (EutureTask.java:354) at java.util.concurrent.FutureTask.setException (EutureTask.java:223) at java.util.concurrent.FutureTask.run (EutureTask.java: 242 at android.os.AsynclaskeSerialExecutorl.run cTask.java:243) at java.util.concurrent.ThreadPoolExecutor.runHorker (ThreadPoo1Executor.java:1133) at java.util.concurrent.ThreadPoolExecutorfWorker.run (ThreadPoolExecutor.java: 607) at java. lang.Thread.run (Thread.java:761) Caused by: java.lang.StringIndexOutofBoundsException: length-33 index-33 at java.lang.String.charAt (Native Method) at com.positiveid.mobilechatrevised.Encdecrypt.hexstringToByteArray EncDecrypt.java:60) at com.positiveid.mobilechatrevlsed. EncDecrypt.decrypt (Encbecrypt.Java:40 at com.positiveid.mobilechatrevised.MainActivity FetchPostsTask.doInBackground (Mainactivity.1ava: 261) at ???.positiveld.mobilechatrevised . MainActivitySFetchPostsTask.dolnBackground (HairActivity. java: 211) at android.os.AsyncTask$2.call (AsyncTask.java:305) at java.util.concurrent. FutureTask.run (FutureTask.java:237) 04-05 03:29:34.50 4448-4480/com.positiveid.mobilechatrevised D/EGL_enmlation: eglMakeCurrent: 0x9d29e700: ver 2 0 (tinfo 0x9d289630) 04-05 03:29:34.801 4448-4448/com.positiveid.mobilechatrevised D/MyRecMsg: myFetchPostsTimerRunnable 04-05 03:29:34.801 4448-4500/com.positiveid.mobilechatrevised D/MyRecMsg: FetchPostsTask AsyncTask

Explanation / Answer

// Helper method to convert String to byte array. protected byte[] hexStringToByteArray(String s) { this.s=s; int len=s.length(); byte[] data=new byte[len/2]; for (int i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote