Skip to content

Commit

Permalink
Version 2.0.0 Final
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Dev committed Aug 8, 2014
1 parent b1b1ccc commit 2bf2d4b
Show file tree
Hide file tree
Showing 66 changed files with 2,828 additions and 889 deletions.
102 changes: 56 additions & 46 deletions DogeKeeper.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>58D1F5F1-A270-4E20-9220-EE63D55E35AB</string>
<key>IDESourceControlProjectName</key>
<string>DogeKeeper</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>3BEB338D-BAF1-4438-9ADD-75E41B72459F</key>
<string>ssh://github.com/Andrew-Dev/DogeKeeper.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>DogeKeeper.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>3BEB338D-BAF1-4438-9ADD-75E41B72459F</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/Andrew-Dev/DogeKeeper.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>3BEB338D-BAF1-4438-9ADD-75E41B72459F</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>3BEB338D-BAF1-4438-9ADD-75E41B72459F</string>
<key>IDESourceControlWCCName</key>
<string>DogeKeeper</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
15 changes: 15 additions & 0 deletions DogeKeeper/AESCrypt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
37 changes: 37 additions & 0 deletions DogeKeeper/AESCrypt/AESCrypt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// AESCrypt.h
// Gurpartap Singh
//
// Created by Gurpartap Singh on 06/05/12.
// Copyright (c) 2012 Gurpartap Singh
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

@interface AESCrypt : NSObject

+ (NSString *)encrypt:(NSString *)message password:(NSString *)password;
+ (NSString *)decrypt:(NSString *)base64EncodedString password:(NSString *)password;

@end
50 changes: 50 additions & 0 deletions DogeKeeper/AESCrypt/AESCrypt.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// AESCrypt.m
// Gurpartap Singh
//
// Created by Gurpartap Singh on 06/05/12.
// Copyright (c) 2012 Gurpartap Singh
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import "AESCrypt.h"

#import "NSData+Base64.h"
#import "NSString+Base64.h"
#import "NSData+CommonCrypto.h"

@implementation AESCrypt

+ (NSString *)encrypt:(NSString *)message password:(NSString *)password {
NSData *encryptedData = [[message dataUsingEncoding:NSUTF8StringEncoding] AES256EncryptedDataUsingKey:[[password dataUsingEncoding:NSUTF8StringEncoding] SHA256Hash] error:nil];
NSString *base64EncodedString = [NSString base64StringFromData:encryptedData length:[encryptedData length]];
return base64EncodedString;
}

+ (NSString *)decrypt:(NSString *)base64EncodedString password:(NSString *)password {
NSData *encryptedData = [NSData base64DataFromString:base64EncodedString];
NSData *decryptedData = [encryptedData decryptedAES256DataUsingKey:[[password dataUsingEncoding:NSUTF8StringEncoding] SHA256Hash] error:nil];
return [[NSString alloc] initWithData:decryptedData encoding:NSUTF8StringEncoding];
}

@end
22 changes: 22 additions & 0 deletions DogeKeeper/AESCrypt/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2012 Gurpartap Singh

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 17 additions & 0 deletions DogeKeeper/AESCrypt/NSData+Base64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// NSData+Base64.m
// Gurpartap Singh
//
// Created by Gurpartap Singh on 06/05/12.
// Copyright (c) 2012 Gurpartap Singh. All rights reserved.
//

#import <Foundation/Foundation.h>

@class NSString;

@interface NSData (Base64Additions)

+ (NSData *)base64DataFromString:(NSString *)string;

@end
110 changes: 110 additions & 0 deletions DogeKeeper/AESCrypt/NSData+Base64.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
//
// NSData+Base64.h
// Gurpartap Singh
//
// Created by Gurpartap Singh on 06/05/12.
// Copyright (c) 2012 Gurpartap Singh. All rights reserved.
//

#import "NSData+Base64.h"

@implementation NSData (Base64Additions)

+ (NSData *)base64DataFromString:(NSString *)string {
unsigned long ixtext, lentext;
unsigned char ch, inbuf[4], outbuf[3];
short i, ixinbuf;
Boolean flignore, flendtext = false;
const unsigned char *tempcstring;
NSMutableData *theData;

if (string == nil) {
return [NSData data];
}

ixtext = 0;

tempcstring = (const unsigned char *)[string UTF8String];

lentext = [string length];

theData = [NSMutableData dataWithCapacity: lentext];

ixinbuf = 0;

while (true) {
if (ixtext >= lentext) {
break;
}

ch = tempcstring [ixtext++];

flignore = false;

if ((ch >= 'A') && (ch <= 'Z')) {
ch = ch - 'A';
}
else if ((ch >= 'a') && (ch <= 'z')) {
ch = ch - 'a' + 26;
}
else if ((ch >= '0') && (ch <= '9')) {
ch = ch - '0' + 52;
}
else if (ch == '+') {
ch = 62;
}
else if (ch == '=') {
flendtext = true;
}
else if (ch == '/') {
ch = 63;
}
else {
flignore = true;
}

if (!flignore) {
short ctcharsinbuf = 3;
Boolean flbreak = false;

if (flendtext) {
if (ixinbuf == 0) {
break;
}

if ((ixinbuf == 1) || (ixinbuf == 2)) {
ctcharsinbuf = 1;
}
else {
ctcharsinbuf = 2;
}

ixinbuf = 3;

flbreak = true;
}

inbuf [ixinbuf++] = ch;

if (ixinbuf == 4) {
ixinbuf = 0;

outbuf[0] = (inbuf[0] << 2) | ((inbuf[1] & 0x30) >> 4);
outbuf[1] = ((inbuf[1] & 0x0F) << 4) | ((inbuf[2] & 0x3C) >> 2);
outbuf[2] = ((inbuf[2] & 0x03) << 6) | (inbuf[3] & 0x3F);

for (i = 0; i < ctcharsinbuf; i++) {
[theData appendBytes: &outbuf[i] length: 1];
}
}

if (flbreak) {
break;
}
}
}

return theData;
}

@end
Loading

0 comments on commit 2bf2d4b

Please sign in to comment.