How to create "static" key / simple text exchange
Hi
I am completely new to JCE and have a relatively simple licencing scenario.
A program licenced to a client should send information when it's called to a file on a remote-server via ftp. This text-information must be encrypted to that the client is unable to read it.
On the remote-machine that I host myself the encoded information must be decoded by another Java-program.
My first question is, how do I generate a "static" key, that I use in both programs?
Is it really necessary to use Diffie-Hellman Key Exchange to solve this?
Could you advise me a code example that solves this problem?
Thanks.
Marc
Thanks again for your input.
You suggest to use RSA. In the solution that I have figured out I use DES and generate a SecretKey. Would using RSA instead of DES bring me some significiant benefit?
Regards
Marc
From the customer's point of view, what you say
you're sending isn't important - because it's
encrypted, you might be sending ANYthing!
Would you be able to identify the hard-coded code(a
byte-array) from the Java byte-code?Yes. If pressed, and if there was enough at stake, I
could probably figure out how to beat the licensing
even if you wrote the whole app in C++ or native
assembler (although it would be more difficult).
People have been doing this kind of thing forever -
bytes aren't nearly as opaque as folk would like to
believe.
If you happen to have a better solution for licence
validation pls let me know.Licensing is hard. No matter what you do, there
will be a way to get around it. The best you
can do is make breaking your scheme hard enough that
the average user would rather pay for your license
than go through the hassle. How much work is enough
on your part depends on too many things I don't know
(e.g., how much are you charging, what class of
customer are you targetting, what's the risk to the
customer if they're caught violating your license,
etc.).
If your customer is willing to put up code that "calls
home" every time it's run, which sends an encrypted
packet each time it does so, and which will (I
assume?) refuse to work if it doesn't get a proper
answer from home - then go ahead and use RSA to
encrypt your data.
But please don't fool yourself into thinking that you
can absolutely guarantee that no-one will be able to
break your license system. Lots of smart people with
lots of money behind them have been trying for almost
as long as software has been sold - and to date,
they've failed. MS spends a huge amount on building
better license schemes every year, and so far all
they're really managed to do is irritate their
legitimate customers...
Good luck,
Grant
Similar Messages
-
How to create a muli line text area using JavaFx
Hi all,
Since the preview SDK does not contain TextArea any more, I am wondering how to create a muli line text area using JavaFX. The behaviour of this text area/field should be somehow similar to JTextArea in Swing or StyledTextWidget in SWT.
Does JavaFX have any support for this? What would be a sensible approach to create such a widget?
Thanks for your suggestions,
br michaelThis is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
Here's a simple example:
Group {
content: [
TextBox {
text: "This is a multi-line textbox"
lines: 10 // <-- this may/may not be necessary depending on your situation. Default is 5.
multiline: true
}Edited by: loeschg on Jul 29, 2010 2:59 PM -
How to populate both key and text in drop down list in dialog prog screen
Hi, Can anyone please advice how to display both key and text in the drop down list in dialog prog screen. I tried with below code. keys and texts are getting populated in values table but only text is appearing when click on drop down. need to display both key and text in the drop down. Thanks in advance.
TABLES: ZRPP_MODELS, ZRPP_FFLSTRATEGY.
TYPE-POOLS : VRM.
DATA : field_id TYPE VRM_ID ,
values TYPE VRM_VALUES,
value LIKE LINE OF values.
FORM fill_model_list .
select MODEL MODEL_DESC from ZRPP_MODELS into value.
APPEND value TO VALUES.
endselect.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'ZRPP_MODELS-MODEL'
values = values.
ENDFORM.You need to concatenate KEY & VALUES
wa_values-key = '1'.
wa_values-text = '1 - One'.
append wa_values to i_values.
wa_values-key = '2'.
wa_values-text = '2 - Two'.
append wa_values to i_values.
wa_values-key = '3'.
wa_values-text = '3 - Three'.
append wa_values to i_values.
call function 'VRM_SET_VALUES'
exporting
id = 'LIST_BOX'
values = i_values
exceptions
id_illegal_name = 1
others = 2.
a® -
How to create a table using Text Layout Framework?
How to create a table using Text Layout Framework? I meen real tables - like in HTML.
Cell as indipendant TLF should work, I have created my table using same approach and works fine for me ... this is where it is
http://apps.live-documents.com/docs/openWebDoc.do?docId=1480607
Regards
Raf -
Hi,
How to create costing key and wwhere to assign for value fields.Kindly provide me the Tcodes for the same.
I will assgin poiints
Thanks
SunithaHi,
The tcode to create costing key: KE40
The tcode to assign value fields: KE4R -
How to create pdf files with text field data
how to create pdf files with text field data
That looks like it should work, but it doesn't.
I opened the PDF I had created from Word in Acrobat (X Pro). Went to File > Properties. Selected "Change Settings". I then enabled "Restrict editing...", set a password, set "Printing Allowed" to "none", "Changes Allowed" to "none", and ensured that "Enable copying of text..." was disabled.
I saved the PDF file, closed Acrobat, opened the PDF in Reader, and I was still able to select text and graphical objects.
I reopened the PDF in Acrobat, and the document summart still shows everything as allowed. When I click on "show details" (from File > Properties) it shows the correct settings.
Any ideas? -
How to create a custom shape text field?
I have a diamond shape movieClip and I need add a text Field in the same shape format.
Now how to create a diamond shape text field?
Please help me!
Thanks,
Jafythere's no easy way to do that in flash. that's an advanced task.
-
How to create static class in Netbeans ?
I want to create a static class in netbeans.
But it gives error like : static modifier not allowed here. as far as java prog concern it is syntactically correct.
for eg.
public static class Emp
-------body & methods
it looks correct syntactically, but gives error in netbeans, static modifier not allowed here. Why ? How to create static class in netbeans ?DrClap wrote:
I have occasionally seen the name "static class" used to denote a class whose members are all static.I think this is quite common.
But taking the name literally and trying to declare a class "static" is a little naive."naive" or being used to doing that in C#. -
How to create AES keys in Java Card SDK 2.2.1?
The manual is confusing.The oncard building of an AES key is somehow similar to an DES key.
On applet installation build an AES key by:
AESKey key = (AESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_AES,KeyBuilder.LENGTH_AES_128,false);
//Now you can fill the key with random data.
key.setKey(randomDataof128bitLength,(short)0);For generationg random data see RandomData.
But you should keep in mind that most JavaCards only support DES /3DES as symmetric cipher. I only know two card that support AES (g&d SmartCafe Expert 64 and Axalto Cyberflex Access 64 K).
Jan -
How to create Task in Simple Maintenence.
Hi,
How to create Task in Simple Maintenence.
Regards
RajeshHow to create a Task in Simple Maintenence (OM)
Please do not cross post.
Donnie -
How to create a "Command Line"/"Text Validation"
I want to create a command line like the picture. I'm using "Input Text" method for text. Variable name is "myText", Instance Name is "line".
How can I use "if" in input text like this:
Command name is: exit, if user wrote "exit" command, exit the flash app.This is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
Here's a simple example:
Group {
content: [
TextBox {
text: "This is a multi-line textbox"
lines: 10 // <-- this may/may not be necessary depending on your situation. Default is 5.
multiline: true
}Edited by: loeschg on Jul 29, 2010 2:59 PM -
How to create Basic Key Figure, Key Figure and Characteristic
Hello Gurus,
I have copied a standard layout of KP06, named it as a Z- layout and made changes to it, like defined the plan data upload field as Object Currency enabled.
However I want to add a Z-Field , tax holiday unit as a column to this layout which I am not being able to do. The reason is when I go to Insert a new element from Edit > Element > Insert Element and click on 'Key figure with Characteristics' I do not get the Z-Field as a key figure.
I want to define the Z-field as a key figure, so that I can add it as an element.
Would be really nice of you if you can let me know the t-code/menu path to do that.
Regards.Hello Gurus,
I wanted to share this information with you, hoping this will help you to help me.
I also tried to create a Key Figure in t-code GS32. In the table I mention --> FAGLFLEXR and hit enter. It says no Key figure has been defined for FAGLFLEXR. Then I put the cursor on the 'Reference Entry'and click on copy. Then give the name of the Key Field I want to create.
'Create Key Figure' dialog box appears. When I input the 'Row Text' 'Column Text' and click enter, I am getting an error 'The basic key figure entered for table FAGL is not defined'. I go back and do an F4 on 'Basic Key Figure' field, then I do not get any options.
I would be highly grateful if you can let me know how to create this 'Basic Key Figure' for table FAGLFLEXR. -
Hi all,
I'm creating an application by using the J2SE v 1.4.2_10 SDK with NetBeans 4.1 Bundle. I have created 4 button and handles event each. I would like to create a hotkey for each button, "F2" key for jButtton2, "F3" key for jButton3, "F8" key for jButton4, "F1" key for jButton5, once i click on the key, the event will be triggered and the coding inside will be executed.
Actually I have read through a few including How to Write a Key Listener, How to Write a Component Listener, How to Write an Action Listener, How to Use Actions, How to Use Key Bindings... but i really not so clear about that and don't know how to apply that into my task... Hope someone can help me...Thanks
The following is part of my coding...
* RegisterStudent_ADD.java
* Created on November 15, 2005, 11:12 PM
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import java.lang.*;
public class RegisterStudent_ADD extends javax.swing.JFrame {
/** Creates new form RegisterStudent_ADD */
public RegisterStudent_ADD() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jDialog1 = new javax.swing.JDialog();
jOptionPane1 = new javax.swing.JOptionPane();
jLabel7 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
jButton5 = new javax.swing.JButton();
jSeparator2 = new javax.swing.JSeparator();
jLabel1 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jDialog1.getContentPane().setLayout(null);
jDialog1.getContentPane().add(jOptionPane1);
jOptionPane1.setBounds(0, 0, 262, 90);
getContentPane().setLayout(null);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Register Student - ADD");
jLabel7.setText("Student Phone No");
getContentPane().add(jLabel7);
jLabel7.setBounds(5, 180, 150, 14);
jLabel6.setText("Student Address");
getContentPane().add(jLabel6);
jLabel6.setBounds(5, 155, 150, 14);
jLabel5.setText("Student IC# ");
getContentPane().add(jLabel5);
jLabel5.setBounds(5, 130, 150, 14);
jLabel4.setText("Student Name");
getContentPane().add(jLabel4);
jLabel4.setBounds(5, 105, 150, 14);
jLabel2.setText("Student Code");
getContentPane().add(jLabel2);
jLabel2.setBounds(5, 80, 150, 14);
jLabel8.setBorder(new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED));
getContentPane().add(jLabel8);
jLabel8.setBounds(130, 75, 160, 19);
jTextField2.setColumns(8);
jTextField2.setName("");
getContentPane().add(jTextField2);
jTextField2.setBounds(130, 100, 160, 19);
jTextField3.setColumns(8);
jTextField3.setName("");
getContentPane().add(jTextField3);
jTextField3.setBounds(130, 125, 160, 19);
jTextField4.setColumns(8);
jTextField4.setName("");
getContentPane().add(jTextField4);
jTextField4.setBounds(130, 150, 340, 19);
jTextField5.setColumns(10);
jTextField5.setName("");
getContentPane().add(jTextField5);
jTextField5.setBounds(130, 175, 160, 19);
jButton5.setText("F1-Retry");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
getContentPane().add(jButton5);
jButton5.setBounds(5, 34, 90, 23);
getContentPane().add(jSeparator2);
jSeparator2.setBounds(0, 30, 800, 2);
jLabel1.setText("Register Student");
getContentPane().add(jLabel1);
jLabel1.setBounds(5, 10, 150, 14);
getContentPane().add(jSeparator1);
jSeparator1.setBounds(0, 60, 800, 2);
jButton2.setText("F2-NxRec");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
getContentPane().add(jButton2);
jButton2.setBounds(100, 34, 90, 23);
jButton3.setText("F3-PreRec");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
getContentPane().add(jButton3);
jButton3.setBounds(195, 34, 90, 23);
jButton4.setText("F8-Save");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
getContentPane().add(jButton4);
jButton4.setBounds(290, 34, 90, 23);
jLabel3.setText("mode : ADD");
jLabel3.setBorder(new javax.swing.border.TitledBorder(""));
getContentPane().add(jLabel3);
jLabel3.setBounds(680, 3, 100, 25);
setBounds(0, 0, 800, 600);
// </editor-fold>
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
......//some coding here.
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
......//some coding here.
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
......//some coding here.
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
......//some coding here.
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new RegisterStudent_ADD().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JDialog jDialog1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
public javax.swing.JLabel jLabel8;
private javax.swing.JOptionPane jOptionPane1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
// End of variables declaration
}Ning.Use the Action architecture (http://java.sun.com/products/jfc/tsc/articles/actions/):
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
public class HotKeyComponent extends JPanel {
public static void main(String[] args) {
HotKeyComponent c = new HotKeyComponent();
UselessAction a1 = new UselessAction("Action 1", "action.1", KeyStroke.getKeyStroke("F1"));
UselessAction a2 = new UselessAction("Action 2", "action.2", KeyStroke.getKeyStroke("F2"));
UselessAction a3 = new UselessAction("Action 3", "action.3", KeyStroke.getKeyStroke("F4"));
c.addButton(a1);
c.addButton(a2);
c.addButton(a3);
JFrame frame = new JFrame("HotKey Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(100, 100, 400, 300);
frame.add(c);
frame.setVisible(true);
public void addButton(Action action) {
Object command = action.getValue(Action.ACTION_COMMAND_KEY);
KeyStroke stroke = (KeyStroke)action.getValue(Action.ACCELERATOR_KEY);
getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(stroke, command);
getActionMap().put(command, action);
JButton button = new JButton(action);
add(button);
static class UselessAction extends AbstractAction {
public UselessAction(String name, Object actionCommand, KeyStroke stroke) {
putValue(Action.NAME, name);
putValue(Action.ACTION_COMMAND_KEY, actionCommand);
putValue(Action.ACCELERATOR_KEY, stroke);
public void actionPerformed(ActionEvent actionEvent) {
System.out.println("actionPerformed " + getValue(Action.NAME));
}The example contains three buttons. You can either click them, or press the key which is mapped to an Action. -
How to create a key figure in SNP plannignbook which generate FA type order
Hello
trying to create a Key Figure in SNP planning book which generates FA type orders
could kindly suggest how to do it?
thanks
elenaHi,
You would be having different key figures in SNP. The type of orders that you see in Key figure is driven by type of categories or category group that you assign in planning area to each key figure. You can modifiy these cateogry groups in IMG settings.
When you manually create a forecast through a report then automatically you will see those orders in key figures where you have assigned the category FA.
Hope this helps.
Regards
Alhad -
ActionsScript 3 how to create on key down function?
Ok so I understand that you make an event listener and an
event handler, but I do not understand how to create a function
were I can hold down a key and the object keeps moving until the
key is up.
With the following function it only moves it every time I
press a certain key. I need to move while the key is held down
until released. I looked around with google and couldn't really
find anything other than how to do this in AS2, which isn't
helpful. Please help! :D
stage.addEventListener(KeyboardEvent.KEY_DOWN, jumpEvent);
private function jumpEvent(event:KeyboardEvent):void
if(event.keyCode == 17)
nissanZ.x += 10;hey thanks a bunch vario pegged!
its working pretty well :D
Maybe you are looking for
-
Used Migraton Assist to transfer data from old Dell PC onto new Macbook Pro. Data has come across but cannota access the User Account from the Dell. It is displayed on the desktop of the Mac but is requesting and new password. Before we can reset
-
How to find out through which tcode TR is created.
Hi Friends, We have one custom code to create TR for staging of RM for the production. I want to find out whether TR is created through custom tcode or by standard transation. How can I find out this. Thanks, Kiran
-
How to create a data connection with dynamic XML file?
Thanks for all reply first! I have formatted the submitted data into an XML file on the server side,this file can be import to PDF form correctly. I try to send this XML file to the user to let him can review what he has submitted. I guess that I sho
-
Payment programme - reg.
Hello experts, If vendor invoices is generally posted by three users. When running the payment programme is it possible for the user to run the payment programme only for the invoices posted by that user. I yes kindly advice me in this regard. Rega
-
Network Routings not imported through "Bill and Routing Interface" program
Hi, I wanted to import Network routing to Shop Floor Manager hence I am using bom_op_routings_interface and then I am running "Bill and Routing Interface" program. But import program is errored with "You do not have access to items of type standard,