2
0

Merge branch 'master' of github.com:Lyndir/MasterPassword

This commit is contained in:
Maarten Billemont 2014-06-05 21:44:23 -04:00
commit 98bffa3755
15 changed files with 284 additions and 40 deletions

2
External/Pearl vendored

@ -1 +1 @@
Subproject commit daa260b3ecaca266ffcfa597e9350900dda6cc56
Subproject commit 0e9484b6512150fbbfffdddcdec62f8e9a741254

View File

@ -1,2 +1,3 @@
#!/usr/bin/env bash
gcc -I"lib/scrypt/lib" -I"lib/scrypt/libcperciva" -I"lib/proplib/include" -l "crypto_aesctr.o" -l "sha256.o" -l "crypto_scrypt-nosse.o" -l "memlimit.o" -l "scryptenc_cpuperf.o" -l"scryptenc.o" -l"crypto" -l"prop" -L"lib/scrypt" -L"lib/proplib/src/.libs" mpw.c -o mpw
#!/usr/bin/env bash -e
gcc types.c -o types.o
gcc -I"lib/scrypt/lib" -I"lib/scrypt/libcperciva" -l "crypto_aesctr.o" -l "sha256.o" -l "crypto_scrypt-nosse.o" -l "memlimit.o" -l "scryptenc_cpuperf.o" -l"scryptenc.o" -l"types.o" -l"crypto" -L"lib/scrypt" mpw.c -o mpw

78
MasterPassword/C/ciphers Normal file
View File

@ -0,0 +1,78 @@
<?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>MPElementGeneratedEntity</key>
<dict>
<key>Maximum Security Password</key>
<array>
<string>anoxxxxxxxxxxxxxxxxx</string>
<string>axxxxxxxxxxxxxxxxxno</string>
</array>
<key>Long Password</key>
<array>
<string>CvcvnoCvcvCvcv</string>
<string>CvcvCvcvnoCvcv</string>
<string>CvcvCvcvCvcvno</string>
<string>CvccnoCvcvCvcv</string>
<string>CvccCvcvnoCvcv</string>
<string>CvccCvcvCvcvno</string>
<string>CvcvnoCvccCvcv</string>
<string>CvcvCvccnoCvcv</string>
<string>CvcvCvccCvcvno</string>
<string>CvcvnoCvcvCvcc</string>
<string>CvcvCvcvnoCvcc</string>
<string>CvcvCvcvCvccno</string>
<string>CvccnoCvccCvcv</string>
<string>CvccCvccnoCvcv</string>
<string>CvccCvccCvcvno</string>
<string>CvcvnoCvccCvcc</string>
<string>CvcvCvccnoCvcc</string>
<string>CvcvCvccCvccno</string>
<string>CvccnoCvcvCvcc</string>
<string>CvccCvcvnoCvcc</string>
<string>CvccCvcvCvccno</string>
</array>
<key>Medium Password</key>
<array>
<string>CvcnoCvc</string>
<string>CvcCvcno</string>
</array>
<key>Basic Password</key>
<array>
<string>aaanaaan</string>
<string>aannaaan</string>
<string>aaannaaa</string>
</array>
<key>Short Password</key>
<array>
<string>Cvcn</string>
</array>
<key>PIN</key>
<array>
<string>nnnn</string>
</array>
</dict>
<key>MPCharacterClasses</key>
<dict>
<key>V</key>
<string>AEIOU</string>
<key>C</key>
<string>BCDFGHJKLMNPQRSTVWXYZ</string>
<key>v</key>
<string>aeiou</string>
<key>c</key>
<string>bcdfghjklmnpqrstvwxyz</string>
<key>A</key>
<string>AEIOUBCDFGHJKLMNPQRSTVWXYZ</string>
<key>a</key>
<string>AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz</string>
<key>n</key>
<string>0123456789</string>
<key>o</key>
<string>@&amp;%?,=[]_:-+*$#!'^~;()/.</string>
<key>x</key>
<string>AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz0123456789!@#$%^&amp;*()</string>
</dict>
</dict>
</plist>

View File

@ -1 +0,0 @@
../Resources/Data/ciphers.plist

View File

@ -20,7 +20,7 @@
#include <alg/sha256.h>
#include <crypto/crypto_scrypt.h>
#include <prop/proplib.h>
#include "types.h"
#define MP_N 32768
#define MP_r 8
@ -178,38 +178,15 @@ int main(int argc, char *const argv[]) {
free(sitePasswordInfo);
// Determine the cipher.
prop_dictionary_t MPTypes_ciphers = prop_dictionary_internalize_from_file("ciphers.plist");
if (!MPTypes_ciphers) {
fprintf (stderr, "Could not read cipher definitions: %d\n", errno);
return 1;
}
prop_array_t typeCiphers = prop_dictionary_get(prop_dictionary_get(MPTypes_ciphers, "[self classNameOfType:type]"), "[self nameOfType:type]");
if (!typeCiphers) {
fprintf (stderr, "Could not find cipher definition for type: %s\n", siteTypeString);
return 1;
}
prop_string_t cipher = prop_array_get(typeCiphers, sitePasswordSeed[0] % prop_array_count(typeCiphers));
if (!typeCiphers) {
fprintf (stderr, "Missing cipher definitions for type: %s\n", siteTypeString);
return 1;
}
const char *cipher = CipherForType(siteType, sitePasswordSeed);
//trc(@"type %@, ciphers: %@, selected: %@", [self nameOfType:type], typeCiphers, cipher);
// Encode the password from the seed using the cipher.
//NSAssert([seed length] >= [cipher length] + 1, @"Insufficient seed bytes to encode cipher.");
const prop_dictionary_t characterClasses = prop_dictionary_get(MPTypes_ciphers, "MPCharacterClasses");
char *sitePassword = calloc(prop_string_size(cipher) + 1, sizeof(char));
char cipherClass[2] = {0, 0};
for (int c = 0; c < prop_string_size(cipher); ++c) {
const uint16_t keyByte = sitePasswordSeed[c + 1];
cipherClass[0] = prop_string_cstring_nocopy(cipher)[c];
const prop_string_t cipherClassCharacters = prop_dictionary_get(characterClasses, cipherClass);
const char character = prop_string_cstring_nocopy(cipherClassCharacters)[ keyByte % prop_string_size(cipherClassCharacters) ];
char *sitePassword = calloc(strlen(cipher) + 1, sizeof(char));
for (int c = 0; c < strlen(cipher); ++c)
//trc(@"class %@ has characters: %@, index: %u, selected: %@", cipherClass, cipherClassCharacters, keyByte, character);
sitePassword[c] = character;
}
sitePassword[c] = CharacterFromClass(cipher[c], sitePasswordSeed[c + 1]);
memset(sitePasswordSeed, 0, sizeof(sitePasswordSeed));
// Output the password.

63
MasterPassword/C/types.c Normal file
View File

@ -0,0 +1,63 @@
//
// MPTypes.h
// MasterPassword
//
// Created by Maarten Billemont on 02/01/12.
// Copyright (c) 2012 Lyndir. All rights reserved.
//
#include <stdio.h>
#include "types.h"
const char *CipherForType(MPElementType type, char seedByte) {
if (!(type & MPElementTypeClassGenerated)) {
fprintf(stderr, "Not a generated type: %d", type);
abort();
}
switch (type) {
case MPElementTypeGeneratedMaximum:
char *ciphers = { "anoxxxxxxxxxxxxxxxxx", "axxxxxxxxxxxxxxxxxno" };
return ciphers[seedByte % 2];
case MPElementTypeGeneratedLong:
char *ciphers = { "CvcvnoCvcvCvcv", "CvcvCvcvnoCvcv", "CvcvCvcvCvcvno", "CvccnoCvcvCvcv", "CvccCvcvnoCvcv", "CvccCvcvCvcvno", "CvcvnoCvccCvcv", "CvcvCvccnoCvcv", "CvcvCvccCvcvno", "CvcvnoCvcvCvcc", "CvcvCvcvnoCvcc", "CvcvCvcvCvccno", "CvccnoCvccCvcv", "CvccCvccnoCvcv", "CvccCvccCvcvno", "CvcvnoCvccCvcc", "CvcvCvccnoCvcc", "CvcvCvccCvccno", "CvccnoCvcvCvcc", "CvccCvcvnoCvcc", "CvccCvcvCvccno" };
return ciphers[seedByte % 21];
case MPElementTypeGeneratedMedium:
char *ciphers = { "CvcnoCvc", "CvcCvcno" };
return ciphers[seedByte % 2];
case MPElementTypeGeneratedBasic:
char *ciphers = { "aaanaaan", "aannaaan", "aaannaaa" };
return ciphers[seedByte % 3];
case MPElementTypeGeneratedShort:
return "Cvcn";
case MPElementTypeGeneratedPIN:
return "nnnn";
}
}
const char CharacterFromClass(char characterClass, char seedByte) {
switch (characterClass) {
case 'V':
return "AEIOU"[seedByte];
case 'C':
return "BCDFGHJKLMNPQRSTVWXYZ"[seedByte];
case 'v':
return "aeiou"[seedByte];
case 'c':
return "bcdfghjklmnpqrstvwxyz"[seedByte];
case 'A':
return "AEIOUBCDFGHJKLMNPQRSTVWXYZ"[seedByte];
case 'a':
return "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz"[seedByte];
case 'n':
return "0123456789"[seedByte];
case 'o':
return "@&amp;%?,=[]_:-+*$#!'^~;()/."[seedByte];
case 'x':
return "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz0123456789!@#$%^&amp;*()"[seedByte];
}
fprintf(stderr, "Unknown character class: %c", characterClass);
abort();
}

42
MasterPassword/C/types.h Normal file
View File

@ -0,0 +1,42 @@
//
// MPTypes.h
// MasterPassword
//
// Created by Maarten Billemont on 02/01/12.
// Copyright (c) 2012 Lyndir. All rights reserved.
//
typedef NS_ENUM(NSUInteger, MPElementContentType) {
MPElementContentTypePassword,
MPElementContentTypeNote,
MPElementContentTypePicture,
};
typedef NS_ENUM(NSUInteger, MPElementTypeClass) {
/** Generate the password. */
MPElementTypeClassGenerated = 1 << 4,
/** Store the password. */
MPElementTypeClassStored = 1 << 5,
};
typedef NS_ENUM(NSUInteger, MPElementFeature) {
/** Export the key-protected content data. */
MPElementFeatureExportContent = 1 << 10,
/** Never export content. */
MPElementFeatureDevicePrivate = 1 << 11,
};
typedef NS_ENUM(NSUInteger, MPElementType) {
MPElementTypeGeneratedMaximum = 0x0 | MPElementTypeClassGenerated | 0x0,
MPElementTypeGeneratedLong = 0x1 | MPElementTypeClassGenerated | 0x0,
MPElementTypeGeneratedMedium = 0x2 | MPElementTypeClassGenerated | 0x0,
MPElementTypeGeneratedBasic = 0x4 | MPElementTypeClassGenerated | 0x0,
MPElementTypeGeneratedShort = 0x3 | MPElementTypeClassGenerated | 0x0,
MPElementTypeGeneratedPIN = 0x5 | MPElementTypeClassGenerated | 0x0,
MPElementTypeStoredPersonal = 0x0 | MPElementTypeClassStored | MPElementFeatureExportContent,
MPElementTypeStoredDevicePrivate = 0x1 | MPElementTypeClassStored | MPElementFeatureDevicePrivate,
};
extern const char *CipherForType(MPElementType type, char seedByte);
extern const char CharacterFromClass(char characterClass, char seedByte);

View File

@ -40,7 +40,7 @@
<li><a href="faq.html">FAQ</a></li>
<li class="active"><a href="algorithm.html">Algorithm</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword">Source (GPL)</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword/">Source (GPL)</a></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
@ -330,6 +330,19 @@ passWord[i] = passChar</pre>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-90535-15'],['_trackPageview']];

View File

@ -6,6 +6,7 @@
<title itemprop="name">Master Password &mdash; Secure your life, forget your passwords.</title>
<meta itemprop="description" content="Master Password is an ingenious password solution that makes your passwords truly impossible to lose." />
<meta itemprop="image" content="http://masterpassword.lyndir.com/img/iTunesArtwork-Rounded.png" />
<meta name="apple-itunes-app" content="app-id=510296984" />
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -39,7 +40,7 @@
<li class="active"><a href="faq.html">FAQ</a></li>
<li><a href="algorithm.html">Algorithm</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword">Source (GPL)</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword/">Source (GPL)</a></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
@ -240,6 +241,19 @@
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-90535-15'],['_trackPageview']];

View File

@ -140,7 +140,7 @@
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "banner";
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';

View File

@ -16,6 +16,6 @@
</style>
</head>
<body>
<p></p>
<p><a href="http://masterpasswordapp.com/support.html">Open support</a> if you have any issues.</p>
</body>
</html>

View File

@ -40,7 +40,7 @@
<li><a href="faq.html">FAQ</a></li>
<li><a href="algorithm.html">Algorithm</a></li>
<li class="active"><a href="support.html">Support</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword">Source (GPL)</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword/">Source (GPL)</a></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
@ -108,6 +108,19 @@
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-90535-15'],['_trackPageview']];

View File

@ -6,6 +6,7 @@
<title itemprop="name">Master Password &mdash; Secure your life, forget your passwords.</title>
<meta itemprop="description" content="Master Password is an ingenious password solution that makes your passwords truly impossible to lose." />
<meta itemprop="image" content="http://masterpassword.lyndir.com/img/iTunesArtwork-Rounded.png" />
<meta name="apple-itunes-app" content="app-id=510296984" />
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -39,7 +40,7 @@
<li><a href="faq.html">FAQ</a></li>
<li><a href="algorithm.html">Algorithm</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword">Source (GPL)</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword/">Source (GPL)</a></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
@ -427,6 +428,19 @@
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-90535-15'],['_trackPageview']];

View File

@ -40,7 +40,7 @@
<li><a href="faq.html">FAQ</a></li>
<li><a href="algorithm.html">Algorithm</a></li>
<li class="active"><a href="support.html">Support</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword">Source (GPL)</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword/">Source (GPL)</a></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
@ -115,6 +115,19 @@
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-90535-15'],['_trackPageview']];

View File

@ -6,6 +6,7 @@
<title itemprop="name">Master Password &mdash; Secure your life, forget your passwords.</title>
<meta itemprop="description" content="Master Password is an ingenious password solution that makes your passwords truly impossible to lose." />
<meta itemprop="image" content="http://masterpassword.lyndir.com/img/iTunesArtwork-Rounded.png" />
<meta name="apple-itunes-app" content="app-id=510296984" />
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -39,7 +40,7 @@
<li><a href="faq.html">FAQ</a></li>
<li><a href="algorithm.html">Algorithm</a></li>
<li class="active"><a href="support.html">Support</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword">Source (GPL)</a></li>
<li><a href="http://github.com/Lyndir/MasterPassword/">Source (GPL)</a></li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
@ -82,6 +83,9 @@
<p>Also consider giving it a few minutes time. Since iCloud often involves communication between your phone and Apple's servers, this may sometimes take a moment. Let your phone sit there for up to 10 minutes with the app open. Your data might just suddenly re-appear.
<h2>Make sure iCloud is turned on</h2>
<p>Some people have reported issues with their app going blank when they had enabled iCloud but didn't have iCloud turned on for their device. When you choose to use iCloud, make sure you're logged into your iCloud account in Settings and that Document sync is actually enabled.</p>
<h2>Re-enable iCloud from Settings</h2>
<p>Sometimes, iCloud just stops talking to Apple's servers. There's no indication of why iCloud encounters this problem, but the following steps may jug it back to life. The idea is to delete your iCloud account from your phone using Settings, and then add it back. After adding your account back, all your iCloud-stored things will just come back to your phone from the cloud. Hopefully, this will include your Master Password sites.
<ul class="pictures">
@ -155,6 +159,19 @@
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- Internet Defense League -->
<script type="text/javascript">
window._idl = {};
_idl.variant = "modal";
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','UA-90535-15'],['_trackPageview']];