【问题标题】:How i can store my password in Titanium?我如何在 Titanium 中存储我的密码?
【发布时间】:2013-09-04 06:34:01
【问题描述】:

如何在钛应用程序中存储我的密码(字符串)? 例如,钛是否具有类似 android 密钥的功能?

(我只需要安卓)

谢谢!

【问题讨论】:

    标签: android security titanium appcelerator appcelerator-mobile


    【解决方案1】:

    iOS(和 Mac)有一种机制来存储密码和类似安全的东西,称为钥匙串。对于 Titanium,有一个模块支持此 API,称为 securely

    安全安装后,此时保存密码很简单:

    var securely = require('bencoding.securely');
    
    //You can provide optional identifier, if none provided securely uses your bundle id
    // This wraps the Keychain functions
    var SecureProperties = securely.createProperties({
        identifier:"Foo",
        accessGroup:"Bar"
    });
    
    // Now add it to the properties
    SecureProperties.setString('Password', the_password_var);
    // Get it back
    var MyPassword = SecureProperties.getString("password");
    

    【讨论】:

      【解决方案2】:

      您检查过钛的FileSystem。你可以使用Properties来存储数据

      你试过用这个吗

      Titanium.App.Properties.setString("password","P@ssw0rD"); 
      var MyPassword = Titanium.App.Properties.getString("password");
      

      也请查看this

      【讨论】:

      • 这不安全,您永远不应该以纯文本形式存储密码。 See this answer
      • 为什么不加密字符串然后stackoverflow.com/questions/610048/…
      • 那么当 Keystore 用于此目的时,您将必须存储/管理您的公钥,并拥有自己的加密 JS 库(这会使国际应用商店提交变得复杂)。我并不是说这行不通,只是需要做很多工作才能确保安全。
      • 它不安全。
      猜你喜欢
      • 1970-01-01
      • 2020-04-14
      • 2022-08-10
      • 2023-04-05
      • 2014-01-17
      • 2010-12-07
      • 2011-09-07
      • 2020-10-29
      • 2023-02-07
      相关资源
      最近更新 更多