Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
increased readability publication on github
Browse files Browse the repository at this point in the history
  • Loading branch information
yahesh committed Sep 2, 2016
1 parent 60c6793 commit cdb045a
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 80 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.6b0 (2016-09-02)

* version bump for increased readability publication on github

# 0.5b1 (2016-09-02)

* fixed copy-to-clipboard feature when password-protection feature is disabled
* increased readability of optional code that is added for password-protection feature

# 0.5b0 (2016-09-02)

* version bump for improved Mozilla Observatory rating publication on github
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

# Shared-Secrets v0.5b0
# Shared-Secrets v0.6b0
#
# Copyright (c) 2016, SysEleven GmbH
# All rights reserved.
Expand Down
12 changes: 5 additions & 7 deletions pages/how/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@
<p>...just use the <a href="/">secret sharing form</a> we provide for your convenience.</p>

<?php

if (ENABLE_PASSWORD_PROTECTION) {

?>

<h2>Short description of the password-protection feature.</h2>
<p>When using the password-protection feature, the secret is encrypted locally using the AES algorithm in GCM mode. The encryption key is derived from the entered password and a dynamically generated salt using the PBKDF2 algorithm. The dynamically generated salt is prepended to the encrypted secret. The password-protection feature is implemented using client-side JavaScript. Please beware that a compromised server may serve you JavaScript code that defeats the purpose of the local encryption. If you do not trust the server that provides the secret sharing service, then encrypt your secret with a locally installed application before sharing it.

<h2>Short description of the password-protection feature.</h2>
<p>When using the password-protection feature, the secret is encrypted locally using the AES algorithm in GCM mode. The encryption key is derived from the entered password and a dynamically generated salt using the PBKDF2 algorithm. The dynamically generated salt is prepended to the encrypted secret. The password-protection feature is implemented using client-side JavaScript. Please beware that a compromised server may serve you JavaScript code that defeats the purpose of the local encryption. If you do not trust the server that provides the secret sharing service, then encrypt your secret with a locally installed application before sharing it.
<?php

}
?>

<?php

# include header
require_once(ROOT_DIR."/template/footer.php");
Expand Down
20 changes: 10 additions & 10 deletions pages/read/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
# include header
require_once(ROOT_DIR."/template/header.php");

if (ENABLE_PASSWORD_PROTECTION) {

?>

<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to read password-protected secrets.
</div>
</noscript>

<?php

if (ENABLE_PASSWORD_PROTECTION) {
?>
<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to read password-protected secrets.
</div>
</noscript>
<?php
}

?>

<h1>Read a Secret:</h1>
Expand All @@ -32,6 +30,8 @@
<button type="submit" class="btn btn-default pull-right" id="read-secret-btn" name="read-secret-btn">Read the Secret!</button>
</form>

<link href="/resources/css/read.css" integrity="sha256-miIkI5gYeETYUyNUudOMl2RkZ9Akko+1KXYfxih5dD0=" rel="stylesheet" type="text/css" />

<?php

# include footer
Expand Down
51 changes: 24 additions & 27 deletions pages/read/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,47 @@
# include header
require_once(ROOT_DIR."/template/header.php");

if (ENABLE_PASSWORD_PROTECTION) {

?>

<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to read password-protected secrets.
</div>
</noscript>
<div class="alert alert-danger" id="decrypt-error">
<strong>Error!</strong> Local decryption failed.
<?php
if (ENABLE_PASSWORD_PROTECTION) {
?>
<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to read password-protected secrets.
</div>

</noscript>
<div class="alert alert-danger" id="decrypt-error">
<strong>Error!</strong> Local decryption failed.
</div>
<?php

}

?>

<h1>Read a Secret:</h1>
<p><pre id="secret"><?php print(read_secret(SECRET_URI)); ?></pre>
<button type="btn" class="btn btn-default pull-right" data-clipboard-target="#secret" id="copy-to-clipboard">Copy to Clipboard!</button></p>

<?php
<link href="/resources/css/read.css" integrity="sha256-miIkI5gYeETYUyNUudOMl2RkZ9Akko+1KXYfxih5dD0=" rel="stylesheet" type="text/css" />

if (ENABLE_PASSWORD_PROTECTION) {
<script src="/vendors/clipboard/clipboard.min.js" integrity="sha256-YPxFEfHAzLj9n2T+2UXAKGNCRUINk0BexppujiVhRH0=" type="text/javascript"></script>
<script src="/resources/js/copy-to-clipboard.js" integrity="sha256-LRwH9pTwY5TAE7KIJSReEy1y29iPc/AbugOTd1LOjrc=" type="text/javascript"></script>

<?php
if (ENABLE_PASSWORD_PROTECTION) {
?>
<label class="checkbox-inline" for="decrypt-locally"><input type="checkbox" autocomplete="off" id="decrypt-locally" value="" />Password-protected: </label>
<input type="password" autocomplete="off" class="form-control" id="password" maxlength="64" size="32" />
<input type="button" class="btn btn-default" id="decrypt" value="Unprotect!" />

<label class="checkbox-inline" for="decrypt-locally"><input type="checkbox" autocomplete="off" id="decrypt-locally" value="" />Password-protected: </label>
<input type="password" autocomplete="off" class="form-control" id="password" maxlength="64" size="32" />
<input type="button" class="btn btn-default" id="decrypt" value="Unprotect!" />

<link href="/resources/css/read.css" integrity="sha256-miIkI5gYeETYUyNUudOMl2RkZ9Akko+1KXYfxih5dD0=" rel="stylesheet" type="text/css" />

<script src="/vendors/asmcrypto/asmcrypto.js" integrity="sha256-+3Ja+u+3rug2giERjvQSkhc1GZ1jG8ebXZ5TbQe2890=" type="text/javascript"></script>
<script src="/vendors/buffer/index.js" integrity="sha256-+fItxTnTLDK8HaHyqiP4cD+RxwDK66DqoTE91HqUfnM=" type="text/javascript"></script>
<script src="/vendors/clipboard/clipboard.min.js" integrity="sha256-YPxFEfHAzLj9n2T+2UXAKGNCRUINk0BexppujiVhRH0=" type="text/javascript"></script>
<script src="/resources/js/copy-to-clipboard.js" integrity="sha256-LRwH9pTwY5TAE7KIJSReEy1y29iPc/AbugOTd1LOjrc=" type="text/javascript"></script>
<script src="/resources/js/read.js" integrity="sha256-c/Xg8fJJ0mVIZ7f/V5m0BWsgX3AQ/mgl1VOvXNBP4Ps=" type="text/javascript"></script>

<script src="/vendors/asmcrypto/asmcrypto.js" integrity="sha256-+3Ja+u+3rug2giERjvQSkhc1GZ1jG8ebXZ5TbQe2890=" type="text/javascript"></script>
<script src="/vendors/buffer/index.js" integrity="sha256-+fItxTnTLDK8HaHyqiP4cD+RxwDK66DqoTE91HqUfnM=" type="text/javascript"></script>
<script src="/resources/js/read.js" integrity="sha256-c/Xg8fJJ0mVIZ7f/V5m0BWsgX3AQ/mgl1VOvXNBP4Ps=" type="text/javascript"></script>
<?php

}
?>

<?php

# include footer
require_once(ROOT_DIR."/template/footer.php");
Expand Down
46 changes: 21 additions & 25 deletions pages/share/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,21 @@
# include header
require_once(ROOT_DIR."/template/header.php");

if (ENABLE_PASSWORD_PROTECTION) {

?>

<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to share password-protected secrets.
</div>
</noscript>
<div class="alert alert-danger" id="encrypt-error">
<strong>Error!</strong> Local encryption failed.
<?php
if (ENABLE_PASSWORD_PROTECTION) {
?>
<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to share password-protected secrets.
</div>

</noscript>
<div class="alert alert-danger" id="encrypt-error">
<strong>Error!</strong> Local encryption failed.
</div>
<?php

}

?>

<form role="form" action="/<?php print(htmlentities(urlencode(SECRET_URI))); ?>" method="post">
Expand All @@ -34,25 +32,23 @@
<button type="submit" class="btn btn-default pull-right" id="share-secret-btn" name="share-secret-btn">Share the Secret!</button>
</form>

<?php
<link href="/resources/css/share.css" integrity="sha256-d3wZL0SNgWVcA6m0aWipQ9T/4I0p55dnYZCVKzsaYlo=" rel="stylesheet" type="text/css" />

<?php
if (ENABLE_PASSWORD_PROTECTION) {

?>
<label class="checkbox-inline" for="encrypt-locally"><input type="checkbox" autocomplete="off" id="encrypt-locally" value="" />Password-protected: </label>
<input type="password" autocomplete="off" class="form-control" id="password" maxlength="64" size="32" />
<input type="button" class="btn btn-default" id="encrypt" value="Protect!" />

<label class="checkbox-inline" for="encrypt-locally"><input type="checkbox" autocomplete="off" id="encrypt-locally" value="" />Password-protected: </label>
<input type="password" autocomplete="off" class="form-control" id="password" maxlength="64" size="32" />
<input type="button" class="btn btn-default" id="encrypt" value="Protect!" />

<link href="/resources/css/share.css" integrity="sha256-d3wZL0SNgWVcA6m0aWipQ9T/4I0p55dnYZCVKzsaYlo=" rel="stylesheet" type="text/css" />

<script src="/vendors/asmcrypto/asmcrypto.js" integrity="sha256-+3Ja+u+3rug2giERjvQSkhc1GZ1jG8ebXZ5TbQe2890=" type="text/javascript"></script>
<script src="/vendors/buffer/index.js" integrity="sha256-+fItxTnTLDK8HaHyqiP4cD+RxwDK66DqoTE91HqUfnM=" type="text/javascript"></script>
<script src="/resources/js/share.js" integrity="sha256-HJaUUzmSuv9fd99m8Fr1c/Mxh0J88JLL/R6xisdXTZ4=" type="text/javascript"></script>

<script src="/vendors/asmcrypto/asmcrypto.js" integrity="sha256-+3Ja+u+3rug2giERjvQSkhc1GZ1jG8ebXZ5TbQe2890=" type="text/javascript"></script>
<script src="/vendors/buffer/index.js" integrity="sha256-+fItxTnTLDK8HaHyqiP4cD+RxwDK66DqoTE91HqUfnM=" type="text/javascript"></script>
<script src="/resources/js/share.js" integrity="sha256-HJaUUzmSuv9fd99m8Fr1c/Mxh0J88JLL/R6xisdXTZ4=" type="text/javascript"></script>
<?php

}
?>

<?php

# include footer
require_once(ROOT_DIR."/template/footer.php");
Expand Down
20 changes: 10 additions & 10 deletions pages/share/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
# include header
require_once(ROOT_DIR."/template/header.php");

if (ENABLE_PASSWORD_PROTECTION) {

?>

<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to share password-protected secrets.
</div>
</noscript>

<?php

if (ENABLE_PASSWORD_PROTECTION) {
?>
<noscript>
<div class="alert alert-warning">
<strong>Warning!</strong> You don't have JavaScript enabled. You will not be able to share password-protected secrets.
</div>
</noscript>
<?php
}

?>

<h1>Share a Secret:</h1>
<p><pre id="secret"><?php print(share_secret(SECRET_PARAM)); ?></pre>
<button type="btn" class="btn btn-default pull-right" data-clipboard-target="#secret" id="copy-to-clipboard">Copy to Clipboard!</button></p>

<link href="/resources/css/share.css" integrity="sha256-d3wZL0SNgWVcA6m0aWipQ9T/4I0p55dnYZCVKzsaYlo=" rel="stylesheet" type="text/css" />

<script src="/vendors/clipboard/clipboard.min.js" integrity="sha256-YPxFEfHAzLj9n2T+2UXAKGNCRUINk0BexppujiVhRH0=" type="text/javascript"></script>
<script src="/resources/js/copy-to-clipboard.js" integrity="sha256-LRwH9pTwY5TAE7KIJSReEy1y29iPc/AbugOTd1LOjrc=" type="text/javascript"></script>

Expand Down

0 comments on commit cdb045a

Please sign in to comment.