I'm not very good at encryption. If anyone has any idea how to help me, speak)).

I have a device that connects to the phone and reads information from a credit card - a kind of card reader .

So here I get this array

 44 55 66 77 00 00 21 37 af f9 67 f9 55 80 32 69 b8 d4 d1 39 62 9b c7 c2 1c 41 ae e9 16 64 39 c7 e6 e7 a6 c0 3d 2b e9 5e e2 71 3b e3 7a 05 bd 82 46 02 09 29 fe b7 5c 28 8d e6 6f a4 3d 72 4a 4c b2 d3 62 4e 2d 08 c7 0c f9 49 97 fe c3 0b b8 9a dd 56 f5 a2 3a 0f c6 f9 89 39 3a 1a 38 26 90 25 30 78 4a 81 6b 78 da 28 ad 41 da 48 4e 60 58 73 e5 c4 c1 45 af 35 1f 52 d7 74 f0 99 25 1f 01 05 31 30 30 30 00 00 00 00 00 00 00 00 

which is the way to convert with the string

 String[] tmps = event.getValue().split(" "); StringBuffer sbf = new StringBuffer(); for (String str : tmps) { sbf.append((char) Integer.parseInt(str, 16)); sbf.append(" "); } final String data = sbf.toString().replaceAll(" ", ""); 

And in the end I get this value

 DUfw    !7¯ùgùU2i¸ÔÑ9bÇÂA®éd9Çæç¦À=+é^âq;ãz½F )þ·\(æo¤=rJL²ÓbN-ÇùIþøÝVõ¢:Æù9:8&%0xJkxÚ(AÚHN`XsåÄÁE¯5R×tð%1000                 

I have this check

 // plain text of card data if (data.toUpperCase().startsWith("B") && idx > 0 && data.indexOf("?") > 0) { 

which says that you can get clean data if the line starts with B , in another case

 // encryption data of card data else if (data.length() > 20 + 5 + 4) { 

This is encrypted data.

So I can not figure out how to decrypt them or how to make sure that they were not originally encrypted.

I tried to decipher in different systems in 10, 2, 8, but nothing happened.

If you forgot something, ask.

    2 answers 2

    It seems that DUfw 44 55 66 77 is a protocol descriptor, and 1000 at the end is a protocol terminator. Everything between them is some kind of encrypted stream that you are not decrypting, otherwise I will begin to doubt the intelligence of the developers of the protocol for exchanging data with the card :)

    Do not suffer.

    • if I understand correctly, this is an encrypted string that will not be decrypted, right? - Aleksey Timoshchenko
    • Give info what card and what data you take from there and in the course of what? Transactions of sale, authorization or what it is. More details - Barmaley
    • The situation is such that I have a device that connects to the phone card reader and can read cards with this device is a demo version of the project with sample code how to use. I need to figure out how the code works and embed this implementation in my project that will use this card data to pay utility bills. The card is an ordinary credit card, it can be said that this is a purchase and sale transaction. The seller of the device said that it reads the data and everything works, but I get them encrypted and I can not understand whether I can fix it or not. What do you say? - Aleksey Timoshchenko
    • I found the key E3 CB 50 99 5C E9 0E A2 06 7A C9 25 45 A5 B6 3A please tell me how to use it to decrypt? - Aleksey Timoshchenko
    • Does it need to be applied to a hex string or already to a String that I got in the end? - Aleksey Timoshchenko

    In my opinion, your question has no answer, since it is quite possible that it is impossible to decrypt this string. If there is no additional data on the type of encryption, then your question is meaningless. If the encryption system is done qualitatively, then your conversion to 2, 8, 10 CC, obviously, will not give anything.

    • Yes, I understand that maybe my question does not make sense, so at first I said that I didn’t understand much about it and maybe I missed something - Aleksey Timoshchenko