简体   繁体   English

Mac上的XOR加密文件

[英]XOR encrypt file on mac

I have an xml file that I was looking to do simple encryption on which I then download in an IOS app and decrypt. 我有一个xml文件,我一直在进行简单的加密,然后将其下载到IOS应用程序中并解密。

I was looking at possibly using XOR encryption. 我当时正在研究可能使用XOR加密。 I have managed to sort out the decryption in objective-C but was wondering if anybody knows a simple way to take an xml and encrypt using XOR (and a key) on a MAC. 我设法在Objective-C中解决了解密问题,但想知道是否有人知道一种简单的方法来获取xml并使用MAC上的XOR(和密钥)进行加密。

"XOR Encryption" is a little vague. “ XOR加密”有点模糊。 Any stream cipher could be considered "XOR" since that is how the key stream is applied to the plaintext to make the ciphertext. 可以将任何流密码视为“ XOR”,因为这是将密钥流应用于明文以形成密文的方式。

If what you mean is "repeatedly XORing a key to the plaintext to make the ciphertext" (aka the Vigenere cipher), then you're already done, because the decryption function is the same as the encryption function. 如果您的意思是“反复对明文的密钥进行异或以生成密文”(又名Vigenere密码),那么您已经完成了,因为解密功能与加密功能相同。

(And if that is what you're talking about, I hope that it's just for your own education or amusement and not for any production code. The Vigenere cipher does not provide any amount of protection.) (如果那是您在说的,我希望这只是出于您自己的教育或娱乐目的,而不是为了任何生产代码。Vigenere密码不提供任何保护。)

感谢您的回复-最后,我使用iOS的RNCryptor和终端上的openssl进行ads-256-cdc加密

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

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