简体   繁体   English

如何在IOS上加密字符串并在Windows中解密?

[英]How would I encrypt a string on IOS and decrypt in windows?

I would like to encrypt a string (password) on: 我想在以下位置加密字符串(密码):

  • an iOS device (in Objective C) iOS设备(在Objective C中)
  • an Android device (in Java) Android设备(使用Java)
  • a Windows phone (in C#) Windows电话(在C#中)

...and then send that string via http to a Windows Server that will decrypt it (in C#). ...然后通过http将字符串发送到Windows服务器,该服务器将使用C#对其进行解密。

Is there some utility / library / encryption engine that is capable of doing such a task? 是否有一些实用程序/库/加密引擎能够执行此任务?

Would you provide sample code for: 您是否可以提供以下示例代码:

  • iOS device (in Objective C) iOS设备(在Objective C中)
  • Android device (in Java) Android设备(Java)

Thanks 谢谢

If you use a standard encryption algorithm (such as AES256), and all platforms have the appropriate keys, then this shouldn't be a problem. 如果您使用标准的加密算法(例如AES256),并且所有平台都具有适当的密钥,那么这应该不是问题。

Consider using CommonCrypto on iOS 考虑在iOS上使用CommonCrypto

Example on Android Android上的示例

And System.Security.Cryptography on Windows Phone / Windows Server Windows Phone / Windows Server上的System.Security.Cryptography

However, what is the problem you are trying to solve? 但是,您要解决的问题是什么? If you want to encrypt data in transit, why not use HTTPS with an SSL certificate? 如果要对传输中的数据进行加密,为什么不将HTTPS与SSL证书一起使用?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM