-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New shader build script. - Swift platform macros.
- Loading branch information
1 parent
1339c34
commit ede6bb1
Showing
22 changed files
with
1,087 additions
and
132 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// main.m | ||
// EncryptFile | ||
// | ||
// Created by Colin Caufield on 2016-03-07. | ||
// Copyright © 2016 Secret Geometry, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "AQDataExtensions.h" | ||
|
||
#define VALIDATE | ||
|
||
int main(int argc, const char* argv[]) | ||
{ | ||
if (argc != 4) | ||
{ | ||
NSLog(@"Usage: EncryptFile <input-file> <output-file> <password>.\n"); | ||
return 1; | ||
} | ||
|
||
NSString* inputFilename = [NSString stringWithUTF8String:argv[1]]; | ||
NSString* outputFilename = [NSString stringWithUTF8String:argv[2]]; | ||
NSString* password = [NSString stringWithUTF8String:argv[3]]; | ||
|
||
NSData* rawData = [NSData dataWithContentsOfFile:inputFilename]; | ||
if (rawData == nil || rawData.length == 0) | ||
{ | ||
NSLog(@"Error reading from file %@.\n", inputFilename); | ||
return 1; | ||
} | ||
|
||
NSData* encryptedData = [rawData dataEncryptedWithPassword:password]; | ||
if (encryptedData == nil || encryptedData.length == 0) | ||
{ | ||
NSLog(@"Error encrypting with password %@.\n", password); | ||
return 1; | ||
} | ||
|
||
BOOL writeOk = [encryptedData writeToFile:outputFilename atomically:NO]; | ||
if (writeOk == NO) | ||
{ | ||
NSLog(@"Error writing to file %@.\n", outputFilename); | ||
return 1; | ||
} | ||
|
||
#ifdef VALIDATE | ||
|
||
NSData* unencryptedData = [encryptedData dataDecryptedWithPassword:password]; | ||
if (unencryptedData == nil || ![unencryptedData isEqualToData:rawData]) | ||
{ | ||
NSLog(@"Validation failed.\n"); | ||
return 1; | ||
} | ||
|
||
#endif | ||
|
||
return 0; | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
134 changes: 134 additions & 0 deletions
134
...arget Support Files/Pods-EncryptFile/Pods-EncryptFile-acknowledgements.markdown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
164 changes: 164 additions & 0 deletions
164
Pods/Target Support Files/Pods-EncryptFile/Pods-EncryptFile-acknowledgements.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.