开发者

How to shift bytes of an NSString?

开发者 https://www.devze.com 2023-03-07 04:37 出处:网络
I have a NSStringlike @\"123456\". I want to convert this string into byte array and then I want to shift some bytes using some arithmetic operations. Then I want to apply SHA256Hash on that and final

I have a NSString like @"123456". I want to convert this string into byte array and then I want to shift some bytes using some arithmetic operations. Then I want to apply SHA256Hash on that and finally want to encrypt a string using the final result. I have trie开发者_StackOverflow社区d many approaches but still got no success. I am very confused in this.If someone wants to look at code i'll post the code.

Edit:

My actual goal is to encrypt an string using AES256 encryption algorithm. And I want to generate my own key and I want to pass my own IV.


I assume you're trying achieve some kind of security. On the other hand it does not look like you're very familiar with the tools and methods you're using. This is a bad start.

Security is a very difficult thing to do—even for experienced developers. Maybe there's a way to reuse some existing implementation for your security needs.

My advice would be not to reinvent things, especially when they are as hard and as crucial as security.

0

精彩评论

暂无评论...
验证码 换一张
取 消