DSA is a digital signature scheme. It does not guarantee that full information about input is preserved and is thus not suitable for encryption/decryption.
On Tue, Dec 8, 2015 at 6:21 AM Naval Saini <navalno...@gmail.com> wrote: > I am facing a confusion/problem regarding DSA encryption on Android (the > plain text is not same as the decrypted cipher text). My code is uploaded > at https://gist.github.com/navalsaini/e87a16927612ad0310b0 . > > I would appreciate any tips. This looks like a straight forward > implementation, but is not working correctly. Please advice me on what do I > need to look into. > > byte[] inpPhnum, encPhnum, decPhnum; > > inpPhnum = "00000000".getBytes(); > encPhnum = crypt.encrypt(inpPhnum); > > decPhnum = crypt.decrypt(encPhnum); > > Log.d(TAG, "Number 1: " + Arrays.toString(inpPhnum)); > Log.d(TAG, "Number 2: " + Arrays.toString(decPhnum)); > > > Results in following output: > > > D/ENCTest: Number 1: [48, 48, 48, 48, 48, 48, 48, 48] > > D/ENCTest: Number 2: [-105, 33, -79, 31, 95, 123, -95, 24, -65, -2, -118, > -24, 120, 48, 31, -47] > > -- > You received this message because you are subscribed to the Google Groups > "Android Security Discussions" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to android-security-discuss+unsubscr...@googlegroups.com. > Visit this group at > http://groups.google.com/group/android-security-discuss. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Android Security Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-security-discuss+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/android-security-discuss. For more options, visit https://groups.google.com/d/optout.