0

How i can store my password (string) in titanium application? Is titanium have analog for android secret key, for example?

(i need it only for android)

Thanks!

Coddy
  • 165
  • 1
  • 2
  • 12

2 Answers2

1

iOS (and Mac) has a mechanism for storing passwords and things like that securely called the Keychain. With Titanium, there is a module that supports this API called securely.

Once you have securely installed, it is a simple matter to save the password at this point:

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");
Josiah Hester
  • 6,065
  • 1
  • 24
  • 37
-4

Have you checked the FileSystem of Titanium. You can use Properties to store data

Have you tried using this

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

Please check this also

Girish Nair
  • 5,148
  • 5
  • 40
  • 61
  • 4
    This is NOT secure, you should never store passwords in plain text. [See this answer](http://stackoverflow.com/a/6972305/874257) – Josiah Hester Sep 04 '13 at 11:49
  • Why dont you encrypt the strings then http://stackoverflow.com/questions/610048/rsa-encryption-decryption-compatible-with-javascript-and-php – Girish Nair Sep 05 '13 at 05:24
  • 2
    Then you would have to store / manage your public keys, and have your own encryption JS library (which complicates international app store submission) when the Keystore is meant for this purpose. I'm not saying this wont work, just a lot of work to be secure. – Josiah Hester Sep 05 '13 at 11:21
  • It is not secured. – Soumya Jan 05 '17 at 15:36