Author: ecki
Date: Sat Dec 27 09:36:25 2014
New Revision: 1648040
URL: http://svn.apache.org/r1648040
Log:
Added JavaDoc warning about DefaultCryptor
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
commons/proper/vfs/trunk/src/changes/changes.xml
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java?rev=1648040&r1=1648039&r2=1648040&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
Sat Dec 27 09:36:25 2014
@@ -21,6 +21,10 @@ import javax.crypto.spec.SecretKeySpec;
/**
* Allows passwords to be encrypted and decrypted.
+ * <p>
+ * Warning: This uses AES128 with a fixed encryption key.
+ * This is only an obfuscation no cryptographic secure protection.
+ *
* @since 2.0
*/
public class DefaultCryptor implements Cryptor
@@ -39,6 +43,10 @@ public class DefaultCryptor implements C
/**
* Encrypt the plain text password.
+ * <p>
+ * Warning: This uses AES128 with a fixed encryption key.
+ * This is only an obfuscation no cryptographic secure protection.
+ *
* @param plainKey The password.
* @return The encrypted password String.
* @throws Exception If an error occurs.
@@ -79,6 +87,7 @@ public class DefaultCryptor implements C
return new String(plainText).substring(0, ptLength);
}
+ /** Hex-encode bytes. */
private String encode(final byte[] bytes)
{
final StringBuilder builder = new StringBuilder();
@@ -91,6 +100,7 @@ public class DefaultCryptor implements C
return builder.toString();
}
+ /** Decodes Hey-Bytes. */
private byte[] decode(final String str)
{
final int length = str.length() / 2;
Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1648040&r1=1648039&r2=1648040&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Sat Dec 27 09:36:25 2014
@@ -26,6 +26,9 @@
<!-- <action issue="VFS-443" dev="ggregory" type="update"
due-to="nickallen"> -->
<!-- [Local] Need an easy way to convert from a FileObject to a File.
-->
<!-- </action> -->
+ <action issue="VFS-551" dev="ecki" type="fix" due-to="David Camilo
Espitia Manrique">
+ Javadoc: make it clear that DefaultCryptor is only an obfuscation
function.
+ </action>
<action issue="VFS-309" dev="ecki" type="fix">
DefaultFileContent will remove thread data whenever possible to avoid
leaks.
</action>