2

For one of my project I need to send a POST request from Arduino (using GSM modem) to PHP web server over Internet cloud. I need to transmit userid card details to webserver for authentication.

I tried using RC4 security algo and found that Ardunio and PHP supports both - so my encryption and decryption using some dummy values went fine.

However I have a concern. Suppose my secret msg is - 'Secret'. After RC4 encryption the encrypted string contains non-readable characters - so the issue is for decryption I would not know the length of encrypted string.

Is it that if the length of input plain text is say 6 ( 'Secret' ) the output encrypted string will also always be 6?

With this assumption my encryption / decryption is working fine though in Arduino (C/C++ stack) and Web Server(PHP)?

Programmer
  • 8,303
  • 23
  • 78
  • 162

1 Answers1

5

Yes, RC4, being a stream cipher, has the same output size (cipher text) as the input (plain text).

Marcus Adams
  • 53,009
  • 9
  • 91
  • 143