패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.5

get_secure_storage

get_storage의 보안 버전으로, Dart로 완전히 작성된 빠르고 매우 가볍며 동기식 키-값 저장소입니다

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.5천
좋아요
29
Pub 점수
130

패키지 설치

flutter pub add get_secure_storage

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

GetSecureStorage는 Dart 애플리케이션을 위한 보안성과 동기식 키-값 저장 솔루션으로, GetStorage 위에 구축되었습니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 다양한 플랫폼에서 암호화된 데이터 지속성을 제공합니다. 표준 저장소와 달리 값 저장 전에 암호화하여 민감한 정보를 보호하므로, 인증 정보, 토큰 또는 개인 사용자 데이터를 저장하는 데 이상적입니다. 이 패키지는 전신의 가볍고 빠른 성능을 유지하면서 강력한 보안 기능을 추가했습니다.

사용 사례

  • 사용자 인증 토큰 저장
  • 암호화된 API 키 저장
  • 민감한 사용자 선호 사항 유지
  • 세션 데이터 보호
  • 로그인 자격 증명 보호
  • 안전한 오프라인 데이터 저장 활성화

주요 기능

  • 저장된 데이터의 엔드 투 엔드 암호화
  • 예측 가능한 실행을 위한 동기식 API
  • 크로스 플랫폼 호환성
  • 경량이고 빠른 성능
  • 간단한 키-값 인터페이스
  • GetStorage 위에 구축됨

적합한 대상

  • 안전한 데이터 지속성을 필요로 하는 앱
  • 간단함과 속도를 우선시하는 개발자
  • 민감한 사용자 정보를 처리하는 프로젝트
  • 오프라인 필요가 있는 모바일 및 데스크톱 애플리케이션
  • 최소한의 종속성으로 플러터를 사용하는 팀

고려 사항

  • 대규모 데이터 세트에 적합하지 않습니다
  • 암호화는 미미한 성능 오버헤드를 추가합니다
  • 신중한 키 관리가 필요합니다
  • 기본 키-값 연산에 제한됨
  • 내장된 데이터 마이그레이션 지원 없음
  • 하위 GetStorage 구현에 따라 다름

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

get_secure_storage

A cryptography Secure version of GetStorage originally written by Jonny Borges (https://github.com/jonataslaw/get_storage).

GetSecureStorage is a secure, fast, extra light and synchronous key-value in memory, which backs up data to disk at each operation. It is written entirely in Dart and is based on the Cryptography dart package.

The cryptography library used is https://pub.dev/packages/cryptography

The algorithm used is 128bit AES-CTR with MAC sha256

Supports Android, iOS, Web, Mac, Linux, and Windows. Can store String, int, double, Map and List

Add to your pubspec:
dependencies:
  get_secure_storage:
Install it

You can install packages from the command line:

with Flutter:

$  flutter packages get
Import it

Now in your Dart code, you can use:

import 'package:get_secure_storage/get_secure_storage.dart';
Initialize storage driver with await:
main() async {
  await GetSecureStorage.init(password: 'strongpassword');
  runApp(App());
}
use GetSecureStorage through an instance or use directly GetSecureStorage().read('key')
final box = GetSecureStorage(password: 'strongpassword');
To write information you must use write :
box.write('quote', 'GetSecureStorage is the best');
To read values you use read:
print(box.read('quote'));
// out: GetSecureStorage is the best

To remove a key, you can use remove:
box.remove('quote');
To listen changes you can use listen:
Function? disposeListen;
disposeListen = box.listen((){
  print('box changed');
});
If you subscribe to events, be sure to dispose them when using:
disposeListen?.call();
To listen changes on key you can use listenKey:
box.listenKey('key', (value){
  print('new key is $value');
});
To erase your container:
box.erase();
If you want to create different containers, simply give it a name. You can listen to specific containers, and also delete them.
GetSecureStorage g = GetSecureStorage(container:'MyStorage', password: 'strongpassword');
To initialize specific container:
await GetSecureStorage.init(container:'MyStorage', password: 'strongpassword');

SharedPreferences Implementation

class MyPref {
  static final _otherBox = () => GetSecureStorage(container:'MyPref', password: 'strongpassword');

  final username = ''.val('username');
  final age = 0.val('age');
  final price = 1000.val('price', getBox: _otherBox);

  // or
  final username2 = ReadWriteValue('username', '');
  final age2 = ReadWriteValue('age', 0);
  final price2 = ReadWriteValue('price', '', _otherBox);
}

...

void updateAge() {
  final age = 0.val('age');
  // or 
  final age = ReadWriteValue('age', 0, () => box);
  // or 
  final age = Get.find<MyPref>().age;

  age.val = 1; // will save to box
  final realAge = age.val; // will read from box
}

카테고리

의존성

의존성 목록 3 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.