├── .gitattributes
├── .gitignore
├── LICENSE
├── Readme.md
├── android
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── rnpbkdf2
│ ├── PBKDF2.java
│ └── PBKDF2Package.java
├── index.js
├── ios
├── RCTPBKDF2
│ ├── RCTPBKDF2.h
│ ├── RCTPBKDF2.m
│ └── lib
│ │ ├── PBKDF2.h
│ │ └── PBKDF2.m
└── RNPBKDF2.xcodeproj
│ └── project.pbxproj
├── package.json
└── yarn.lock
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # OSX
3 | #
4 | .DS_Store
5 |
6 | # node.js
7 | #
8 | node_modules/
9 | npm-debug.log
10 | yarn-error.log
11 |
12 |
13 | # Xcode
14 | #
15 | build/
16 | *.pbxuser
17 | !default.pbxuser
18 | *.mode1v3
19 | !default.mode1v3
20 | *.mode2v3
21 | !default.mode2v3
22 | *.perspectivev3
23 | !default.perspectivev3
24 | xcuserdata
25 | *.xccheckout
26 | *.moved-aside
27 | DerivedData
28 | *.hmap
29 | *.ipa
30 | *.xcuserstate
31 | project.xcworkspace
32 |
33 |
34 | # Android/IntelliJ
35 | #
36 | build/
37 | .idea
38 | .gradle
39 | local.properties
40 | *.iml
41 |
42 | # BUCK
43 | buck-out/
44 | \.buckd/
45 | *.keystore
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Quanto Open Source
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # React Native PBKDF2
2 | > A Password Based Key Derivation 2 (PBKDF2) algorithm for React Native
3 |
4 | [](https://tldrlegal.com/license/mit-license)
5 |
6 | PBKDF2 (Password-Based Key Derivation Function 2) are key derivation functions with a sliding computational cost, aimed to reduce the vulnerability of encrypted keys to brute force attacks.
7 |
8 | PBKDF2 applies a pseudorandom function, such as hash-based message authentication code (HMAC), to the input password or passphrase along with a salt value and repeats the process many times to produce a derived key, which can then be used as a cryptographic key in subsequent operations. The added computational work makes password cracking much more difficult, and is known as key stretching.
9 |
10 | ## Motivation
11 | The motivation for create this _lib_ is to make a isolated and native way to use PBKDF2 algorithm in React Native. Because it's more simple to usage and maintain. The existent _libs_ today or are not using native code or don't keep a semantic, isolated and clean usage.
12 |
13 | The _lib_ [PublicaIO/react-native-pbkdf2](https://github.com/PublicaIO/react-native-pbkdf2), for example, not use the native code and the [react-native-aes](https://github.com/tectiv3/react-native-aes) contain some other methods
14 |
15 | > This _lib_ is totally based on [react-native-aes](https://github.com/tectiv3/react-native-aes), but with some improvements like `iteration` param suppport.
16 |
17 | ## Getting started
18 |
19 | `$ yarn add https://github.com/quan-to/react-native-pbkdf2`
20 |
21 | ### Linking
22 |
23 | `$ react-native link react-native-pbkdf2`
24 |
25 | ### Manual installation
26 |
27 |
28 | #### iOS
29 |
30 | 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
31 | 2. Go to `node_modules` ➜ `react-native-pbkdf2` and add `RNPBKDF2.xcodeproj`
32 | 3. In XCode, in the project navigator, select your project. Add `libRCTPBKDF2.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
33 | 4. Run your project (`Cmd+R`)<
34 |
35 | #### Android
36 |
37 | 1. Open up `android/app/src/main/java/[...]/MainActivity.java`
38 | - Add `import rnpbkdf2.PBKDF2Package;` to the imports at the top of the file
39 | - Add `new PBKDF2Package()` to the list returned by the `getPackages()` method
40 | 2. Append the following lines to `android/settings.gradle`:
41 | ```
42 | include ':react-native-pbkdf2'
43 | project(':react-native-pbkdf2').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pbkdf2/android')
44 | ```
45 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
46 | ```
47 | compile project(':react-native-pbkdf2')
48 | ```
49 |
50 |
51 | ## Usage
52 | ```javascript
53 | import PBKDF2 from 'react-native-pbkdf2'
54 |
55 | PBKDF2.derivationKey('P4S5W0RD', '032145', 10000)
56 | .then((derivationKey) => console.log(derivationKey))
57 | .catch(...)
58 | ```
59 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "26.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 19
9 | targetSdkVersion 22
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile 'com.android.support:appcompat-v7:23.0.1'
23 | compile 'com.facebook.react:react-native:+'
24 | compile 'com.madgag.spongycastle:core:1.58.0.0'
25 | compile 'com.madgag.spongycastle:prov:1.54.0.0'
26 | compile 'com.madgag.spongycastle:pkix:1.54.0.0'
27 | compile 'com.madgag.spongycastle:pg:1.54.0.0'
28 | }
29 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/java/rnpbkdf2/PBKDF2.java:
--------------------------------------------------------------------------------
1 | package rnpbkdf2;
2 |
3 | import com.facebook.react.bridge.Promise;
4 | import com.facebook.react.bridge.ReactApplicationContext;
5 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
6 | import com.facebook.react.bridge.ReactMethod;
7 |
8 | import org.spongycastle.crypto.digests.SHA512Digest;
9 | import org.spongycastle.crypto.generators.PKCS5S2ParametersGenerator;
10 | import org.spongycastle.crypto.params.KeyParameter;
11 |
12 | import java.nio.charset.StandardCharsets;
13 | import java.security.NoSuchAlgorithmException;
14 | import java.security.spec.InvalidKeySpecException;
15 |
16 | public class PBKDF2 extends ReactContextBaseJavaModule {
17 |
18 | private static final Integer SHA512_DIGEST_LENGTH = 512;
19 |
20 | public PBKDF2(ReactApplicationContext reactContext) {
21 | super(reactContext);
22 | }
23 |
24 | public static String bytesToHex(byte[] bytes) {
25 | final char[] hexArray = "0123456789abcdef".toCharArray();
26 | char[] hexChars = new char[bytes.length * 2];
27 | for (int j = 0; j < bytes.length; j++) {
28 | int v = bytes[j] & 0xFF;
29 | hexChars[j * 2] = hexArray[v >>> 4];
30 | hexChars[j * 2 + 1] = hexArray[v & 0x0F];
31 | }
32 | return new String(hexChars);
33 | }
34 |
35 | private static String derivationKey(String pwd, String salt, Integer cost, Integer length)
36 | throws NoSuchAlgorithmException, InvalidKeySpecException {
37 | PKCS5S2ParametersGenerator gen = new PKCS5S2ParametersGenerator(new SHA512Digest());
38 | gen.init(pwd.getBytes(StandardCharsets.UTF_8), salt.getBytes(StandardCharsets.UTF_8), cost);
39 | byte[] key = ((KeyParameter) gen.generateDerivedParameters(length)).getKey();
40 | return bytesToHex(key);
41 | }
42 |
43 | @Override
44 | public String getName() {
45 | return "PBKDF2";
46 | }
47 |
48 | @ReactMethod
49 | public void derivationKey(String pwd, String salt, Integer iterations, Promise promise) {
50 | try {
51 | String strs = derivationKey(pwd, salt, iterations, SHA512_DIGEST_LENGTH);
52 | promise.resolve(strs);
53 | } catch (Exception e) {
54 | promise.reject("-1", e.getMessage());
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/android/src/main/java/rnpbkdf2/PBKDF2Package.java:
--------------------------------------------------------------------------------
1 | package rnpbkdf2;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.JavaScriptModule;
5 | import com.facebook.react.bridge.NativeModule;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.uimanager.ViewManager;
8 |
9 | import java.util.Arrays;
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | public class PBKDF2Package implements ReactPackage {
14 | @Override
15 | public List createNativeModules(ReactApplicationContext reactContext) {
16 | return Arrays.asList(
17 | new PBKDF2(reactContext)
18 | );
19 | }
20 |
21 | public List> createJSModules() {
22 | return Collections.emptyList();
23 | }
24 |
25 | @Override
26 | public List createViewManagers(ReactApplicationContext reactContext) {
27 | return Arrays.asList();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 |
2 | import { NativeModules } from 'react-native'
3 |
4 | const { PBKDF2 } = NativeModules
5 |
6 | export default PBKDF2
7 |
--------------------------------------------------------------------------------
/ios/RCTPBKDF2/RCTPBKDF2.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface RCTPBKDF2 : NSObject
4 |
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/RCTPBKDF2/RCTPBKDF2.m:
--------------------------------------------------------------------------------
1 | #import "RCTPBKDF2.h"
2 | #import "PBKDF2.h"
3 |
4 | @implementation RCTPBKDF2
5 |
6 | RCT_EXPORT_MODULE()
7 |
8 | RCT_EXPORT_METHOD(derivationKey:(NSString *)password salt:(NSString *)salt iterations:(nonnull int *)iterations
9 | resolver:(RCTPromiseResolveBlock)resolve
10 | rejecter:(RCTPromiseRejectBlock)reject) {
11 | NSError *error = nil;
12 | NSString *data = [PBKDF2 derivationKey:password salt:salt iterations: iterations];
13 | if (data == nil) {
14 | reject(@"keygen_fail", @"Key generation failed", error);
15 | } else {
16 | resolve(data);
17 | }
18 | }
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/ios/RCTPBKDF2/lib/PBKDF2.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface PBKDF2 : NSObject
4 | + (NSString *) derivationKey:(NSString *)password salt: (NSString *)salt iterations: (nonnull int *)iterations;
5 | + (NSString *) toHex: (NSData *)nsdata;
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/RCTPBKDF2/lib/PBKDF2.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 |
5 | #import "PBKDF2.h"
6 |
7 | @implementation PBKDF2
8 |
9 | + (NSString *) toHex:(NSData *)nsdata {
10 | NSString * hexStr = [NSString stringWithFormat:@"%@", nsdata];
11 | for(NSString * toRemove in [NSArray arrayWithObjects:@"<", @">", @" ", nil])
12 | hexStr = [hexStr stringByReplacingOccurrencesOfString:toRemove withString:@""];
13 | return hexStr;
14 | }
15 |
16 | + (NSString *) derivationKey:(NSString *)password salt: (NSString *)salt iterations: (nonnull int *)iterations {
17 | // Data of String to generate Hash key(hexa decimal string).
18 | NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding];
19 | NSData *saltData = [salt dataUsingEncoding:NSUTF8StringEncoding];
20 |
21 | // Hash key (hexa decimal) string data length.
22 | NSMutableData *hashKeyData = [NSMutableData dataWithLength:CC_SHA512_DIGEST_LENGTH];
23 |
24 | // Key Derivation using PBKDF2 algorithm.
25 | int status = CCKeyDerivationPBKDF(
26 | kCCPBKDF2,
27 | passwordData.bytes,
28 | passwordData.length,
29 | saltData.bytes,
30 | saltData.length,
31 | kCCPRFHmacAlgSHA512,
32 | iterations,
33 | hashKeyData.mutableBytes,
34 | hashKeyData.length);
35 |
36 | if (status == kCCParamError) {
37 | NSLog(@"Key derivation error");
38 | return @"";
39 | }
40 |
41 | return [self toHex:hashKeyData];
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/ios/RNPBKDF2.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 32D980E11BE9F11C00FA27E5 /* RCTPBKDF2.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 32D980E01BE9F11C00FA27E5 /* RCTPBKDF2.h */; };
11 | 32D980E31BE9F11C00FA27E5 /* RCTPBKDF2.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D980E21BE9F11C00FA27E5 /* RCTPBKDF2.m */; };
12 | 9BE20B5B1E4E1A3700696172 /* PBKDF2.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE20B5A1E4E1A3700696172 /* PBKDF2.m */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | 32D980DB1BE9F11C00FA27E5 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/$(PRODUCT_NAME)";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | 32D980E11BE9F11C00FA27E5 /* RCTPBKDF2.h in CopyFiles */,
23 | );
24 | runOnlyForDeploymentPostprocessing = 0;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | 32D980DD1BE9F11C00FA27E5 /* libRCTPBKDF2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTPBKDF2.a; sourceTree = BUILT_PRODUCTS_DIR; };
30 | 32D980E01BE9F11C00FA27E5 /* RCTPBKDF2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTPBKDF2.h; sourceTree = ""; };
31 | 32D980E21BE9F11C00FA27E5 /* RCTPBKDF2.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTPBKDF2.m; sourceTree = ""; };
32 | 9BE20B591E4E1A3700696172 /* PBKDF2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBKDF2.h; sourceTree = ""; };
33 | 9BE20B5A1E4E1A3700696172 /* PBKDF2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBKDF2.m; sourceTree = ""; };
34 | /* End PBXFileReference section */
35 |
36 | /* Begin PBXFrameworksBuildPhase section */
37 | 32D980DA1BE9F11C00FA27E5 /* Frameworks */ = {
38 | isa = PBXFrameworksBuildPhase;
39 | buildActionMask = 2147483647;
40 | files = (
41 | );
42 | runOnlyForDeploymentPostprocessing = 0;
43 | };
44 | /* End PBXFrameworksBuildPhase section */
45 |
46 | /* Begin PBXGroup section */
47 | 32D980D41BE9F11C00FA27E5 = {
48 | isa = PBXGroup;
49 | children = (
50 | 32D980DF1BE9F11C00FA27E5 /* RCTPBKDF2 */,
51 | 32D980DE1BE9F11C00FA27E5 /* Products */,
52 | );
53 | sourceTree = "";
54 | };
55 | 32D980DE1BE9F11C00FA27E5 /* Products */ = {
56 | isa = PBXGroup;
57 | children = (
58 | 32D980DD1BE9F11C00FA27E5 /* libRCTPBKDF2.a */,
59 | );
60 | name = Products;
61 | sourceTree = "";
62 | };
63 | 32D980DF1BE9F11C00FA27E5 /* RCTPBKDF2 */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 32D980E01BE9F11C00FA27E5 /* RCTPBKDF2.h */,
67 | 32D980E21BE9F11C00FA27E5 /* RCTPBKDF2.m */,
68 | 32D981161BE9F1B600FA27E5 /* lib */,
69 | );
70 | path = RCTPBKDF2;
71 | sourceTree = "";
72 | };
73 | 32D981161BE9F1B600FA27E5 /* lib */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 9BE20B591E4E1A3700696172 /* PBKDF2.h */,
77 | 9BE20B5A1E4E1A3700696172 /* PBKDF2.m */,
78 | );
79 | path = lib;
80 | sourceTree = "";
81 | };
82 | /* End PBXGroup section */
83 |
84 | /* Begin PBXNativeTarget section */
85 | 32D980DC1BE9F11C00FA27E5 /* RCTPBKDF2 */ = {
86 | isa = PBXNativeTarget;
87 | buildConfigurationList = 32D980F11BE9F11C00FA27E5 /* Build configuration list for PBXNativeTarget "RCTPBKDF2" */;
88 | buildPhases = (
89 | 32D980D91BE9F11C00FA27E5 /* Sources */,
90 | 32D980DA1BE9F11C00FA27E5 /* Frameworks */,
91 | 32D980DB1BE9F11C00FA27E5 /* CopyFiles */,
92 | );
93 | buildRules = (
94 | );
95 | dependencies = (
96 | );
97 | name = RCTPBKDF2;
98 | productName = RCTPBKDF2;
99 | productReference = 32D980DD1BE9F11C00FA27E5 /* libRCTPBKDF2.a */;
100 | productType = "com.apple.product-type.library.static";
101 | };
102 | /* End PBXNativeTarget section */
103 |
104 | /* Begin PBXProject section */
105 | 32D980D51BE9F11C00FA27E5 /* Project object */ = {
106 | isa = PBXProject;
107 | attributes = {
108 | LastUpgradeCheck = 0820;
109 | ORGANIZATIONNAME = tectiv3;
110 | TargetAttributes = {
111 | 32D980DC1BE9F11C00FA27E5 = {
112 | CreatedOnToolsVersion = 6.4;
113 | };
114 | };
115 | };
116 | buildConfigurationList = 32D980D81BE9F11C00FA27E5 /* Build configuration list for PBXProject "RCTPBKDF2" */;
117 | compatibilityVersion = "Xcode 8.0";
118 | developmentRegion = English;
119 | hasScannedForEncodings = 0;
120 | knownRegions = (
121 | en,
122 | );
123 | mainGroup = 32D980D41BE9F11C00FA27E5;
124 | productRefGroup = 32D980DE1BE9F11C00FA27E5 /* Products */;
125 | projectDirPath = "";
126 | projectRoot = "";
127 | targets = (
128 | 32D980DC1BE9F11C00FA27E5 /* RCTPBKDF2 */,
129 | );
130 | };
131 | /* End PBXProject section */
132 |
133 | /* Begin PBXSourcesBuildPhase section */
134 | 32D980D91BE9F11C00FA27E5 /* Sources */ = {
135 | isa = PBXSourcesBuildPhase;
136 | buildActionMask = 2147483647;
137 | files = (
138 | 9BE20B5B1E4E1A3700696172 /* PBKDF2.m in Sources */,
139 | 32D980E31BE9F11C00FA27E5 /* RCTPBKDF2.m in Sources */,
140 | );
141 | runOnlyForDeploymentPostprocessing = 0;
142 | };
143 | /* End PBXSourcesBuildPhase section */
144 |
145 | /* Begin XCBuildConfiguration section */
146 | 32D980EF1BE9F11C00FA27E5 /* Debug */ = {
147 | isa = XCBuildConfiguration;
148 | buildSettings = {
149 | ALWAYS_SEARCH_USER_PATHS = NO;
150 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
151 | CLANG_CXX_LIBRARY = "libc++";
152 | CLANG_ENABLE_MODULES = YES;
153 | CLANG_ENABLE_OBJC_ARC = YES;
154 | CLANG_WARN_BOOL_CONVERSION = YES;
155 | CLANG_WARN_CONSTANT_CONVERSION = YES;
156 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
157 | CLANG_WARN_EMPTY_BODY = YES;
158 | CLANG_WARN_ENUM_CONVERSION = YES;
159 | CLANG_WARN_INFINITE_RECURSION = YES;
160 | CLANG_WARN_INT_CONVERSION = YES;
161 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
162 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
163 | CLANG_WARN_UNREACHABLE_CODE = YES;
164 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
165 | COPY_PHASE_STRIP = NO;
166 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
167 | ENABLE_STRICT_OBJC_MSGSEND = YES;
168 | GCC_C_LANGUAGE_STANDARD = gnu99;
169 | GCC_DYNAMIC_NO_PIC = NO;
170 | GCC_NO_COMMON_BLOCKS = YES;
171 | GCC_OPTIMIZATION_LEVEL = 0;
172 | GCC_PREPROCESSOR_DEFINITIONS = (
173 | "DEBUG=1",
174 | "$(inherited)",
175 | );
176 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
177 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
178 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
179 | GCC_WARN_UNDECLARED_SELECTOR = YES;
180 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
181 | GCC_WARN_UNUSED_FUNCTION = YES;
182 | GCC_WARN_UNUSED_VARIABLE = YES;
183 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
184 | MTL_ENABLE_DEBUG_INFO = YES;
185 | ONLY_ACTIVE_ARCH = YES;
186 | SDKROOT = iphoneos;
187 | };
188 | name = Debug;
189 | };
190 | 32D980F01BE9F11C00FA27E5 /* Release */ = {
191 | isa = XCBuildConfiguration;
192 | buildSettings = {
193 | ALWAYS_SEARCH_USER_PATHS = NO;
194 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
195 | CLANG_CXX_LIBRARY = "libc++";
196 | CLANG_ENABLE_MODULES = YES;
197 | CLANG_ENABLE_OBJC_ARC = YES;
198 | CLANG_WARN_BOOL_CONVERSION = YES;
199 | CLANG_WARN_CONSTANT_CONVERSION = YES;
200 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
201 | CLANG_WARN_EMPTY_BODY = YES;
202 | CLANG_WARN_ENUM_CONVERSION = YES;
203 | CLANG_WARN_INFINITE_RECURSION = YES;
204 | CLANG_WARN_INT_CONVERSION = YES;
205 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
206 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
207 | CLANG_WARN_UNREACHABLE_CODE = YES;
208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
209 | COPY_PHASE_STRIP = NO;
210 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
211 | ENABLE_NS_ASSERTIONS = NO;
212 | ENABLE_STRICT_OBJC_MSGSEND = YES;
213 | GCC_C_LANGUAGE_STANDARD = gnu99;
214 | GCC_NO_COMMON_BLOCKS = YES;
215 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
216 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
217 | GCC_WARN_UNDECLARED_SELECTOR = YES;
218 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
219 | GCC_WARN_UNUSED_FUNCTION = YES;
220 | GCC_WARN_UNUSED_VARIABLE = YES;
221 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
222 | MTL_ENABLE_DEBUG_INFO = NO;
223 | SDKROOT = iphoneos;
224 | VALIDATE_PRODUCT = YES;
225 | };
226 | name = Release;
227 | };
228 | 32D980F21BE9F11C00FA27E5 /* Debug */ = {
229 | isa = XCBuildConfiguration;
230 | buildSettings = {
231 | HEADER_SEARCH_PATHS = (
232 | "$(inherited)",
233 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
234 | "$(SRCROOT)/../../../react-native/React/**",
235 | "$(SRCROOT)/../../../../../node_modules/react-native/React/**",
236 | );
237 | OTHER_LDFLAGS = "-ObjC";
238 | PRODUCT_NAME = "$(TARGET_NAME)";
239 | SKIP_INSTALL = YES;
240 | };
241 | name = Debug;
242 | };
243 | 32D980F31BE9F11C00FA27E5 /* Release */ = {
244 | isa = XCBuildConfiguration;
245 | buildSettings = {
246 | HEADER_SEARCH_PATHS = (
247 | "$(inherited)",
248 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
249 | "$(SRCROOT)/../../../react-native/React/**",
250 | "$(SRCROOT)/../../../../../node_modules/react-native/React/**",
251 | );
252 | OTHER_LDFLAGS = "-ObjC";
253 | PRODUCT_NAME = "$(TARGET_NAME)";
254 | SKIP_INSTALL = YES;
255 | };
256 | name = Release;
257 | };
258 | /* End XCBuildConfiguration section */
259 |
260 | /* Begin XCConfigurationList section */
261 | 32D980D81BE9F11C00FA27E5 /* Build configuration list for PBXProject "RCTPBKDF2" */ = {
262 | isa = XCConfigurationList;
263 | buildConfigurations = (
264 | 32D980EF1BE9F11C00FA27E5 /* Debug */,
265 | 32D980F01BE9F11C00FA27E5 /* Release */,
266 | );
267 | defaultConfigurationIsVisible = 0;
268 | defaultConfigurationName = Release;
269 | };
270 | 32D980F11BE9F11C00FA27E5 /* Build configuration list for PBXNativeTarget "RCTPBKDF2" */ = {
271 | isa = XCConfigurationList;
272 | buildConfigurations = (
273 | 32D980F21BE9F11C00FA27E5 /* Debug */,
274 | 32D980F31BE9F11C00FA27E5 /* Release */,
275 | );
276 | defaultConfigurationIsVisible = 0;
277 | defaultConfigurationName = Release;
278 | };
279 | /* End XCConfigurationList section */
280 | };
281 | rootObject = 32D980D51BE9F11C00FA27E5 /* Project object */;
282 | }
283 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-pbkdf2",
3 | "version": "0.1.1",
4 | "description": "A Password Based Key Derivation 2 (PBKDF2) algorithm for React Native",
5 | "main": "index.js",
6 | "keywords": [
7 | "pbkdf2",
8 | "react-native"
9 | ],
10 | "author": "Daniel Torres ",
11 | "license": "MIT",
12 | "peerDependencies": {
13 | "react-native": "^0.56.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 |
--------------------------------------------------------------------------------