This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"blockSize":4096, | |
"createdAt":1399634734, | |
"fileData":[ | |
{ | |
"46c899e54e096a2cf5ab937c6db4a3cd574b610d":[ | |
"127.0.0.4", | |
"127.0.0.1", | |
"127.0.0.3", | |
"127.0.0.2" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"/111/.sxnewdir":{ | |
"fileSize":0, | |
"blockSize":4096, | |
"createdAt":1550092360, | |
"fileRevision":"2019-02-13 21:12:40.299:051abe9dac472d797fe2853128ef0c4b" | |
}, | |
"/111/Audi-Q5-ABT-tuning.jpg":{ | |
"fileSize":62619, | |
"blockSize":4096, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"volumeList": { | |
"99-bilateral.devtest": { | |
"owner": "99-bilateral", | |
"replicaCount": 2, | |
"effectiveReplicaCount": 2, | |
"maxRevisions": 1, | |
"privs": "rw", | |
"usedSize": 26647432, | |
"sizeBytes": 21474836480, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(NSString *)HMAC_SHA1WithKeyData:(NSData* )key | |
{ | |
const char * cData = [self cStringUsingEncoding:NSASCIIStringEncoding]; | |
unsigned char cHMAC[CC_SHA1_DIGEST_LENGTH]; | |
CCHmac(kCCHmacAlgSHA1, [key bytes], [key length], cData, strlen(cData), cHMAC); | |
NSData *HMAC = [[NSData alloc] initWithBytes:cHMAC | |
length:sizeof(cHMAC)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SKYCloudRequest.m | |
// SXDrive | |
// | |
// Created by Skylable on 04/12/14. | |
// Copyright (C) 2015-2016 Skylable Ltd. <info-copyright@skylable.com> | |
// License: Apache 2.0, see LICENSE for more details. | |
// | |
#import "SKYCloudRequest.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(NSData *)_hashDataSHA1:(NSString*)input withSalt:(NSString *)salt { | |
const char *cstr = [[NSString stringWithFormat:@“%@%@“, salt, input] cStringUsingEncoding:NSUTF8StringEncoding]; | |
NSData *data = [NSData dataWithBytes:cstr length:strlen(cstr)]; | |
unsigned char digest[CC_SHA1_DIGEST_LENGTH]; | |
CC_SHA1(data.bytes, (int)data.length, digest); | |
return [NSData dataWithBytes:(const void *)digest length:CC_SHA1_DIGEST_LENGTH]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(NSString *)_hashHexSHA1:(NSString*)input withSalt:(NSString*)salt { | |
const char *cstr = [[NSString stringWithFormat:@“%@%@“, salt, input] cStringUsingEncoding:NSUTF8StringEncoding]; | |
NSData *data = [NSData dataWithBytes:cstr length:strlen(cstr)]; | |
unsigned char digest[CC_SHA1_DIGEST_LENGTH]; | |
CC_SHA1(data.bytes, (int)data.length, digest); | |
NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH]; | |
for(int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) | |
[output appendFormat:@“%02x”, digest[i]]; | |
return output; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(NSString *)_finalProcessingForUnsaltedUsernameHashData:(NSData* )data1 passwordHashData:(NSData *)data2 { | |
// concatenate data | |
NSMutableData *data = [NSMutableData dataWithData:data1]; | |
[data appendData:data2]; | |
// append by 2 zero bytes | |
unsigned char zeroByte = 0; | |
[data appendBytes:&zeroByte length:1]; | |
[data appendBytes:&zeroByte length:1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(NSString *)_bCryptPassword:(NSString* )password withSaltData:(NSData *)saltData { | |
char keybuf[61]; | |
char settingbuf[30]; | |
const char *genkey, *setting; | |
const char *cPassword = [password cStringUsingEncoding:NSUTF8StringEncoding]; | |
setting = _crypt_gensalt_blowfish_rn(“$2b$“, 14, [saltData bytes], 20, settingbuf, sizeof(settingbuf)); | |
if (!setting) | |
return @“”; | |
genkey = _crypt_blowfish_rn(cPassword, setting, keybuf, sizeof(keybuf)); | |
if (!genkey) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)_generateKeyForLogInData:(SXLogInData *)data { | |
[self _logMessage:[NSString stringWithFormat:@“SHA1 1st step %@“, [self _hashHexSHA1:data.username withSalt:data.uuid]]]; | |
NSString *bCrypt = [self _bCryptPassword:data.password withSaltData:[self _hashDataSHA1:data.username withSalt:data.uuid]]; | |
data.key = [self _finalProcessingForUnsaltedUsernameHashData:[self _hashDataSHA1:data.username withSalt:@“”] passwordHashData:[self _hashDataSHA1:bCrypt withSalt:data.uuid]]; | |
[self performSelectorOnMainThread:@selector(_keyDidGenerateForLogInData:) withObject:data waitUntilDone:NO]; |
NewerOlder