创建应用程序为每个客户的请求提供唯一的ID

发布于 2024-12-08 05:32:36 字数 400 浏览 0 评论 0原文

我所知道的是,我想创建一个在 Linux 系统上运行的应用程序,它将收集系统信息,例如 mac 地址、hd&cpu id、操作系统版本和计算机名称,以及首次执行的时间戳,并对其进行哈希处理全部集成到一个 id 密钥中。然后它会将这个 ID 发送到服务器上,并将其保存以供以后进行身份验证。现在每次客户端发出请求时,应用程序都会生成 id-key 并将其附加到请求中。然后服务器将进行身份验证。

不知道是 a) 我应该制作一个桌面可执行应用程序,还是一个在客户端本地主机上运行的 Web 应用程序,以及每个应用程序如何工作? b) 使用哪种技术,即开发平台(php?) c) 应用程序如何将 id 附加到每个客户端请求以及 d) 有什么准备好的我可以尝试的吗(还没有找到) 提前谢谢您,这有一个截止日期,任何帮助将不胜感激。

What I know is that I want to create an app running on a linux system, that will gather system's information such as mac address, hd&cpu id's, OS version and computer's name, as well as a timestamp of first execution, and hash it all into one id-key. Then it will send this id on server where it will be saved for later authentication. Now Every time the client makes a request the app will generate the id-key and attach it to the request.Then the server will authenticate.

What I don't know is
a) Should I make a desktop executable app, or a web app running on client's localhost, and how each are going to work?
b) Which technology to use, meaning the platform for development (php?)
c) How the app is going to attach the id to every client request and
d) Is there anything ready I can try (haven't found one yet)
Thank you in advance, there is a deadline in this and any help will be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

っ左 2024-12-15 05:32:36

@Stathis G。

要获取客户端的信息,您可以在客户端的计算机上部署一个小程序。

  import java.applet.Applet;
  import java.applet.Applet;
  import java.net.InetAddress;
  import java.net.NetworkInterface;
  import java.net.SocketException;


  public class app extends Applet{

  public String macAddr="";

  public void init()
  {
  try
    {
        System.out.println("Start");
        InetAddress ip = InetAddress.getLocalHost();
        System.out.println((new StringBuilder("Current IP address:"+ip.toString())));
        NetworkInterface network = NetworkInterface.getByInetAddress(ip);
        byte mac[] = network.getHardwareAddress();
        System.out.println("mac : "+mac.toString());
        System.out.print("Current MAC address : ");
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < mac.length; i++)
            sb.append(String.format("%02X%s", new Object[] {
                    Byte.valueOf(mac[i]), i >= mac.length - 1 ? "" : "-"
            }));

        System.out.println(sb.toString());
        macAddr=String.valueOf(sb);
        System.out.println("okay good");

    }
    catch(SocketException e)

    {
        macAddr=e.toString();
        e.printStackTrace();
        System.out.println("not good");
    }
    catch (Exception e) {
        macAddr=e.toString();
        e.printStackTrace();
        System.out.println("bad good");
    }    
   }
   }

制作这个小程序后我遇到的问题是[当我在本地机器上运行它时它工作正常(作为小程序运行)],但它不能在服务器上工作``因为你必须签署你的jar

Keytool -genkey -alias signFiles -keystore compstore -keypass KEYPASS -dname "cn=XYZ" -storepass KEY -validity 125000 jarsigner -keystore compstore -storepass PASS -keypass KEYPASS appletname.jar signFiles

之后它工作但不顺利..每次我运行它时。浏览器都会请求许可。这不好。希望我的经验有帮助

@Stathis G.

To get client's information you can deploy an applet on client's machine.

  import java.applet.Applet;
  import java.applet.Applet;
  import java.net.InetAddress;
  import java.net.NetworkInterface;
  import java.net.SocketException;


  public class app extends Applet{

  public String macAddr="";

  public void init()
  {
  try
    {
        System.out.println("Start");
        InetAddress ip = InetAddress.getLocalHost();
        System.out.println((new StringBuilder("Current IP address:"+ip.toString())));
        NetworkInterface network = NetworkInterface.getByInetAddress(ip);
        byte mac[] = network.getHardwareAddress();
        System.out.println("mac : "+mac.toString());
        System.out.print("Current MAC address : ");
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < mac.length; i++)
            sb.append(String.format("%02X%s", new Object[] {
                    Byte.valueOf(mac[i]), i >= mac.length - 1 ? "" : "-"
            }));

        System.out.println(sb.toString());
        macAddr=String.valueOf(sb);
        System.out.println("okay good");

    }
    catch(SocketException e)

    {
        macAddr=e.toString();
        e.printStackTrace();
        System.out.println("not good");
    }
    catch (Exception e) {
        macAddr=e.toString();
        e.printStackTrace();
        System.out.println("bad good");
    }    
   }
   }

The problem i faced after making this applet is[That it worked fine when i run it on Machine locally (RUN AS APPLET)], buT IT DOESNT WORK ON SERVER`` for that you have to sign your jar

Keytool -genkey -alias signFiles -keystore compstore -keypass KEYPASS -dname "cn=XYZ" -storepass KEY -validity 125000 jarsigner -keystore compstore -storepass PASS -keypass KEYPASS appletname.jar signFiles

After that it worked but not smoothly..as everytime i run it.Browser asks for permission. which is not good. I hope my experience helps

输什么也不输骨气 2024-12-15 05:32:36

有哈希函数可用于生成唯一密钥,但是您可能希望在服务器上创建密钥以防止人们对您的哈希函数进行逆向工程。几年前,我的一个朋友会通过反编译源代码并寻找序列号功能来消除游戏的版权保护。如果您将函数放在客户端上,那么他们可以更改它。

There are hash functions available to generate unique keys, however you might want to create the keys on your server to prevent people from reverse engineering your hash function. Years ago a friend of mine would remove copy protection from games by decompiling the source code and looking for the serial number functions. If you place your function on the client then they can alter it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文