Best security practices when sending a credit card number to a REST API from iOS

梦想的初衷 提交于 2019-12-22 07:51:33

问题


My app has to comunicate with an API, we can do this easily to send and get data.

Right now we send everything as plain text as a parameter of the URL.

I am by no means a security expert, but common sense tells me the credit card number should be encrypted during the transfer.

The server can worry about the storage, my only concern is the actual transmission of the data.

From my reading I undertand that I need a private key encryption algorithm, as it needs to be reversed by the server to get the actual data.

Is a good one already implemented on the CommonCrypto framework?

What would be your recommendation?

I am looking to do this using iOS and I am sure the security frameworks have tools to complete this challenge, I just dont know where to look or what to look for.

Thank you!


回答1:


You should absolutely not be using URL parameters for the credit card information. URLs that are accessed by other clients on a network can be easily sniffed and recorded by other computers on the network (with certain limitations of course).

You should be submitting the info using POST parameters so that they are contained in the body of the message and not the URL itself. Then as long as you are submitting to an HTTPS page, the data should be safe without needing to encrypt it first (the message itself is encrypted using SSL in this case).



来源:https://stackoverflow.com/questions/7424729/best-security-practices-when-sending-a-credit-card-number-to-a-rest-api-from-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!