Hello,
i would like to create a java application package that would have a simple graphical interface that would allow a user to enter words, have them encrypted with other words or symbols , have the encryptions saved so that a password would be required before decryption is done; if it would not be too easy to include a password then the encryptions can just be decypted without password. Thank you .
Comments
: i would like to create a java application package that would have a simple graphical interface that would allow a user to enter words, have them encrypted with other words or symbols , have the encryptions saved so that a password would be required before decryption is done; if it would not be too easy to include a password then the encryptions can just be decypted without password. Thank you .
:
:
Good Luck!!!
If you have questions, please ask them.
[italic][blue]Just my 2 bits[/blue][/italic]
: i would like to create a java application package that would have a simple graphical interface that would allow a user to enter words, have them encrypted with other words or symbols , have the encryptions saved so that a password would be required before decryption is done; if it would not be too easy to include a password then the encryptions can just be decypted without password. Thank you .
:
:
Here is a simple string encryption routine:
[code]
public static String encryptText(String text, String pass)
{
ByteBuffer textBuffer, passBuffer;
int i, j;
Charset charset = Charset.forName("UTF-16BE");
// Allocate & fill memory buffers
textBuffer = ByteBuffer.allocate(text.length()*2);
textBuffer.put(charset.encode(text));
passBuffer = ByteBuffer.allocate(pass.length()*2);
passBuffer.put(charset.encode(pass));
// Perform encryption/decryption using a bitwise XOR
for (i = 0; i < textBuffer.capacity(); i++)
{
j = i%passBuffer.capacity();
textBuffer.put(i, (byte) (textBuffer.get(i)^passBuffer.get(j)));
}
// Transform buffer back to string
textBuffer.rewind();
String s = "";
while (textBuffer.hasRemaining())
{
s = s + textBuffer.getChar();
}
return s;
}
[/code]
This encryption is not considered to be secure, but it shows how to encrypt texts based on a passphrase. By implementing a block cipher (such as the Rijndael or Blowfish) and taking the textBuffer as its input block, you can create more secure crypt.
: : i would like to create a java application package that would have a simple graphical interface that would allow a user to enter words, have them encrypted with other words or symbols , have the encryptions saved so that a password would be required before decryption is done; if it would not be too easy to include a password then the encryptions can just be decypted without password. Thank you .
: :
: :
: Here is a simple string encryption routine:
: [code]
: public static String encryptText(String text, String pass)
: {
: ByteBuffer textBuffer, passBuffer;
: int i, j;
: Charset charset = Charset.forName("UTF-16BE");
:
: // Allocate & fill memory buffers
: textBuffer = ByteBuffer.allocate(text.length()*2);
: textBuffer.put(charset.encode(text));
:
: passBuffer = ByteBuffer.allocate(pass.length()*2);
: passBuffer.put(charset.encode(pass));
:
: // Perform encryption/decryption using a bitwise XOR
: for (i = 0; i < textBuffer.capacity(); i++)
: {
: j = i%passBuffer.capacity();
: textBuffer.put(i, (byte) (textBuffer.get(i)^passBuffer.get(j)));
: }
:
: // Transform buffer back to string
: textBuffer.rewind();
: String s = "";
: while (textBuffer.hasRemaining())
: {
: s = s + textBuffer.getChar();
: }
: return s;
: }
: [/code]
: This encryption is not considered to be secure, but it shows how to encrypt texts based on a passphrase. By implementing a block cipher (such as the Rijndael or Blowfish) and taking the textBuffer as its input block, you can create more secure crypt.
:
hi, having difficulty compiling and running the program.help
: : : i would like to create a java application package that would have a simple graphical interface that would allow a user to enter words, have them encrypted with other words or symbols , have the encryptions saved so that a password would be required before decryption is done; if it would not be too easy to include a password then the encryptions can just be decypted without password. Thank you .
: : :
: : :
: : Here is a simple string encryption routine:
: : [code]
: : public static String encryptText(String text, String pass)
: : {
: : ByteBuffer textBuffer, passBuffer;
: : int i, j;
: : Charset charset = Charset.forName("UTF-16BE");
: :
: : // Allocate & fill memory buffers
: : textBuffer = ByteBuffer.allocate(text.length()*2);
: : textBuffer.put(charset.encode(text));
: :
: : passBuffer = ByteBuffer.allocate(pass.length()*2);
: : passBuffer.put(charset.encode(pass));
: :
: : // Perform encryption/decryption using a bitwise XOR
: : for (i = 0; i < textBuffer.capacity(); i++)
: : {
: : j = i%passBuffer.capacity();
: : textBuffer.put(i, (byte) (textBuffer.get(i)^passBuffer.get(j)));
: : }
: :
: : // Transform buffer back to string
: : textBuffer.rewind();
: : String s = "";
: : while (textBuffer.hasRemaining())
: : {
: : s = s + textBuffer.getChar();
: : }
: : return s;
: : }
: : [/code]
: : This encryption is not considered to be secure, but it shows how to encrypt texts based on a passphrase. By implementing a block cipher (such as the Rijndael or Blowfish) and taking the textBuffer as its input block, you can create more secure crypt.
: :
: hi, having difficulty compiling and running the program.help
:
This is not a program, but a single method. You need to write the program around it.