【问题标题】:Using OpenSSL to generate passwd on iPhone在 iPhone 上使用 OpenSSL 生成密码
【发布时间】:2011-12-25 06:37:16
【问题描述】:

我的 iPhone 上的 OpenSSL 库运行良好,并且可以创建哈希等...

openssl passwd -crypt -salt xxxxxxxxxxxx 密码

我正在库中寻找“passwd”函数,但似乎找不到...

谢谢!

【问题讨论】:

  • 好吧,我想通了。我没有意识到有一个“crypt()”函数可以满足我的需求。对于其他人,只需使用: const char *passwd = crypt(password, salt);

标签: iphone openssl passwd


【解决方案1】:

这里是一个字母数字的答案移到了答案块中:

好的,我有答案了...您只需执行以下操作:

const char *password = [[NSString stringWithFormat:@"passwordstring"] UTF8String];
const char *salt = [[NSString stringWithFormat:@"saltstring"] UTF8String];

const char *passwd = crypt(password, salt);

NSString *theToken = [NSString stringWithUTF8String:passwd];

NSLog(@"%@", theToken);

EZ 模式。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-06-24
    • 2019-08-09
    • 2019-10-20
    • 2020-07-23
    • 2013-12-02
    • 2011-05-16
    • 2012-05-21
    • 2021-09-10
    相关资源
    最近更新 更多