Added protect text FAQ

pull/209/head
M66B 2 years ago
parent e338ac9800
commit 6fe3778feb

@ -393,6 +393,7 @@ Fonts, sizes, colors, etc should be material design whenever possible.
* [(181) How do I use VirusTotal?](#user-content-faq181)
* [(182) How can I select how a link should be opened?](#user-content-faq182)
* [(183) How do I use Send?](#user-content-faq183)
* [(184) How do I password protect text?](#user-content-faq184)
[I have another question.](#user-content-get-support)
@ -4982,6 +4983,23 @@ Send is only available in non-Play Store versions of the app (since version 1.19
<br />
<a name="faq184"></a>
**(184) How do I password protect text?**
Select some text by long pressing it, and in the style toolbar at the bottom tap on the *<ins>A</ins>*-button and select *Password protect* in the pop-up menu.
Password protected text is sent as a [URI fragment](https://en.wikipedia.org/wiki/URI_fragment) and not stored on a server, and decrypted in the browser with JavaScript.
Password protected text is encrypted with AES/GCM with a 256 bits key derived with PBKDF2/SHA-512 with 120,000 iterations.
The maximum message text is 1,500 characters, which includes HTML formatting tags.
This feature is not available in the Play store version of the app.
Sending protected text is a pro feature, decrypting protected text is a free feature.
<br />
<h2><a name="get-support"></a>Get support</h2>
&#x1F30E; [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/FAQ.md%23user-content-get-support)
@ -5033,4 +5051,4 @@ GitHub issues are disabled due to frequent misusage.
<br />
Copyright &copy; 2018-2021 Marcel Bokhorst.
Copyright &copy; 2018-2022 Marcel Bokhorst.

@ -56,6 +56,7 @@ import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
@ -88,6 +89,8 @@ import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.PBEKeySpec;
public class StyleHelper {
private static final int MAX_PROTECTED_TEXT = 1500;
private static final List<Class> CLEAR_STYLES = Collections.unmodifiableList(Arrays.asList(
StyleSpan.class,
UnderlineSpan.class,
@ -573,6 +576,14 @@ public class StyleHelper {
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_password_protect, null);
TextInputLayout etPassword1 = dview.findViewById(R.id.tilPassword1);
TextInputLayout etPassword2 = dview.findViewById(R.id.tilPassword2);
Button btnInfo = dview.findViewById(R.id.btnInfo);
btnInfo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.viewFAQ(v.getContext(), 184);
}
});
Dialog dialog = new AlertDialog.Builder(context)
.setView(dview)
@ -606,6 +617,9 @@ public class StyleHelper {
String password = args.getString("password");
String html = HtmlHelper.toHtml(text, context);
if (html.length() > MAX_PROTECTED_TEXT)
throw new IllegalArgumentException(context.getString(R.string.title_style_protect_size));
SecureRandom random = new SecureRandom();
byte[] salt = new byte[16]; // 128 bits
@ -655,8 +669,12 @@ public class StyleHelper {
@Override
protected void onException(Bundle args, Throwable ex) {
Log.e(ex);
ToastEx.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();
if (ex instanceof IllegalArgumentException)
ToastEx.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show();
else {
Log.e(ex);
ToastEx.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();
}
}
}.execute(context, owner, args, "protect");
}

@ -17,7 +17,7 @@
android:layout_height="wrap_content"
android:drawableStart="@drawable/twotone_lock_24"
android:drawablePadding="6dp"
android:text="@string/title_style_password"
android:text="@string/title_style_protect"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -64,14 +64,15 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/tvHint"
<Button
android:id="@+id/btnInfo"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_style_password_remark"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
android:drawableEnd="@drawable/twotone_info_24"
android:drawablePadding="6dp"
android:text="@string/title_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword2" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -183,7 +183,7 @@
<item
android:id="@+id/menu_style_password"
android:icon="@drawable/twotone_lock_24"
android:title="@string/title_style_password" />
android:title="@string/title_style_protect" />
</group>
<group

@ -1448,8 +1448,8 @@
<string name="title_style_superscript">Superscript</string>
<string name="title_style_strikethrough">Strikethrough</string>
<string name="title_style_code" translatable="false">Code</string>
<string name="title_style_password">Password protect</string>
<string name="title_style_password_remark" translatable="false">AES/GCM 256 bit PBKDF2/SHA-256/120,000</string>
<string name="title_style_protect">Password protect</string>
<string name="title_style_protect_size">Text too long</string>
<string name="title_style_clear">Clear formatting</string>
<string name="title_style_link">Insert link</string>
<string name="title_style_link_address">Address</string>

@ -2,11 +2,11 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Decrypt message</title>
<title>Decrypt text</title>
<meta name="theme-color" content="#006db3">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="Decrypt message">
<meta name="description" content="Decrypt text">
<meta name="author" content="M66B">
<meta name="robots" content="noindex">
@ -116,11 +116,11 @@
<form id="getpassword" action="#" method="GET" style="display: none;">
<p>
Someone sent you an encrypted message with <a href="https://email.faircode.eu/" target="_blank">FairEmail</a>.
Someone sent you password protected text with <a href="https://email.faircode.eu/" target="_blank">FairEmail</a>.
</p>
<fieldset id="fields" style="border:0 none; margin: 0; padding: 0;">
<p>
<label for="password">Password</label><br>
<label for="password">Enter password:</label><br>
<input id="password" name="password" type="password" required><br>
<span style="font-size: smaller;">Passwords are case-sensitive </span>
</p>
@ -129,8 +129,9 @@
</p>
</fieldset>
<p style="font-size: smaller;">
Messages are sent as a <a href="https://en.wikipedia.org/wiki/URI_fragment" target="_blank">URI fragment</a> and not stored on a server, and decrypted in the browser with JavaScript.<br>
Messages are encrypted with AES/GCM with a 256 bits key derived with PBKDF2/SHA-512/120,000 iterations.
Password protected text is sent as a <a href="https://en.wikipedia.org/wiki/URI_fragment" target="_blank">URI fragment</a> and not stored on a server, and decrypted in the browser with JavaScript.<br>
Password protected text is encrypted with AES/GCM with a 256 bits key derived with PBKDF2/SHA-512 with 120,000 iterations.<br>
Please see <a href="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq184" target="_blank">here</a> for more information.
</p>
</form>

Loading…
Cancel
Save