Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared Preferences is not secure enough to store tokens #593

Closed
Hrishikesh-Bhagwat opened this issue Apr 2, 2021 · 4 comments
Closed

Shared Preferences is not secure enough to store tokens #593

Hrishikesh-Bhagwat opened this issue Apr 2, 2021 · 4 comments
Assignees

Comments

@Hrishikesh-Bhagwat
Copy link
Contributor

Issue Description: Sensitive information such as user tokens must not be stored in shared preferences. Some encryption is desirable.
Issue Severity: Medium but can be a big vulnerability
Observed Behavior: Shared preferences stores user tokens in plain text
Expected Behavior: Tokens must be stored using some encryption
Does this issue need immediate attention? Yes
Are you willing to work on this issue: Yes, I will work.

@Hrishikesh-Bhagwat
Copy link
Contributor Author

@Sagar2366 please assign me this issue

@github-actions github-actions bot added the unapproved Unapproved, needs to be triaged label Apr 2, 2021
@Sagar2366 Sagar2366 added enhancement and removed unapproved Unapproved, needs to be triaged labels Apr 3, 2021
@amul-dhungel
Copy link

Hello @Hrishikesh-Bhagwat you can use crypto package from flutter pub dev

import 'dart:convert';
import 'package:crypto/crypto.dart';

void main() {
var key = utf8.encode('token');
var bytes = utf8.encode("foobar");

var hmacSha256 = Hmac(sha256, key);
var digest = hmacSha256.convert(bytes);

print(hmacSha256);
print(digest);

}

@Hrishikesh-Bhagwat
Copy link
Contributor Author

Hi Amul Dhungel! We can use flutter_secure_storage it uses keystore in IOS and AES in android. It will be much better according to me. Thanks for telling me about this too. Actually I have solved this on my end already. There are some conflicts in merging, trying to rectify those!

@amul-dhungel
Copy link

@Hrishikesh-Bhagwat That's great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants