遊客:  註冊 | 登錄 | 幫助





標題: [疑難] 一個要activation o既program (java)
  小神     Rank: 4Rank: 4
水中藍
性別 保密
UID 11831

精華 0
帖子 2634
積分 1386   詳情

閱讀權限 50
註冊 2006-9-12
來自 天堂
狀態 離線

 
 
 
 
發表於 2008-4-10 07:36 AM  資料  個人空間  短訊  加為好友 
一個要activation o既program (java)

用java 點樣可以寫一個要activation o既program?
即係人地要用一個serial no 黎activate 個program..
冇就可能用30日就expire 咁..
用java 應該點寫呢?

頂部

mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2008-4-10 08:32 AM  資料  個人空間  短訊  加為好友 
呢樣我真係未寫過喎!  會 expire 就即係要用 registry 之類記低 installation date?

頂部



  小神     Rank: 4Rank: 4
水中藍
性別 保密
UID 11831

精華 0
帖子 2634
積分 1386   詳情

閱讀權限 50
註冊 2006-9-12
來自 天堂
狀態 離線

 
 
 
 
發表於 2008-4-10 12:02 PM  資料  個人空間  短訊  加為好友 
唔知ar..
我諗緊就咁用一個txt file encrypt d info..
或者整個class 記低個state..
成個object save 落harddisk 度..

不過我唔知點樣可以整個activation code..
咁你整就唔止一個code 要有n 咁多個..
咁你個program 又點知個code 岩定錯呢..

頂部

lhy     Rank: 3
青出藍
性別 男
UID 14043

精華 0
帖子 121
積分 330   詳情

閱讀權限 40
註冊 2006-10-16
來自 Netherlands
狀態 離線

 
 
 
 
發表於 2008-4-10 02:31 PM  資料  個人空間  短訊  加為好友 
I have never done this before but I think it is just like 小神 said. write a class that keep the state of the program (trial or full) and serialize it. when startup the app, deserialize and check the state. Also need a serial matcher or something. To check the serial number the user entered match all the condition a valid serial number must have. sample:

set1-set2-set3-set4-set5

every set of number contains 5 numbers. The nth root number of the first set must be 29. The nth root number of the second set must be 230. etc.....

this is a simple pattern I could think off.. I am sure this is really easy discover by others but this is just an idea. .



最後編輯: lhy : 2008-4-10 02:38 PM
頂部

1022292057     Rank: 4Rank: 4
水中藍
性別 男
UID 17104

精華 0
帖子 165
積分 798   詳情

閱讀權限 50
註冊 2006-12-9
來自 Canada
狀態 離線

 
 
 
 
發表於 2008-4-10 02:51 PM  資料  個人空間  主頁 短訊  加為好友 
u first create ur own encryption formula or choose an encryption theory to use
then decide one or a set of valid keys
create an encrypt function in a separate program (this program will be used to generate serial no.s)
create a decrypt function in ur main java program (serial no will be decrypted with this function to see if matches with the valid key(s))

*to generate infinitely many serial no.s from a single key or a set of keys, u just have to include some free variables in ur encryption formula

when key matches, access flag will be set to 2 and be able to access all functionalities that u limited with IF(access>1){},
access 0 could be no access, 1 could be trial, 2 activated, 3 admin
don't have to store state in harddrive(waste of resource)

done

Example(simple):
using a simple multiplication encryption formula where it will multiple the key by n(free variable, could use random generator), set valid keys to be the set [3,5]
3, 5, 6, 9, 10, 66666, 4125151560, ..., would all be valid serial no., while 0, 1, 7, 11234452, ... would be invalid serial no.
then create a decryption function where it will basically perform {IF serial % (3 or 5) == 0 THEN access=2;}
initial trial access will be 1 and when trial ends can set access to 0
done

頂部

mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2008-4-10 10:18 PM  資料  個人空間  短訊  加為好友 
Good idea and suggestions!  I really start to fall in love with you guys!!  Hahaha!     I just love this kind of discussion!  Can't wait to fully come back and join you.  I am still super busy with my job.  Still putting a lot of overtime.

頂部

  小神     Rank: 4Rank: 4
水中藍
性別 保密
UID 11831

精華 0
帖子 2634
積分 1386   詳情

閱讀權限 50
註冊 2006-9-12
來自 天堂
狀態 離線

 
 
 
 
發表於 2008-4-11 10:25 AM  資料  個人空間  短訊  加為好友 
Thx for the reply
so i can just store the key in a txt file..

頂部

1022292057     Rank: 4Rank: 4
水中藍
性別 男
UID 17104

精華 0
帖子 165
積分 798   詳情

閱讀權限 50
註冊 2006-12-9
來自 Canada
狀態 離線

 
 
 
 
發表於 2008-4-11 11:24 AM  資料  個人空間  主頁 短訊  加為好友 
回復 #7 小神 的帖子

u shouldn't be storing key in txt unless ur activation require key check through internet
usually through internet, u would have ur key in txt encrypted in server-side, then application will decrypt serial num in client and then perform connection to server to check key. This allows more flexibility in altering/adding new keys and also higher security.

However, if not using internet activation, key stored in txt will have to be in client side, which is bad for security reason as it can easily be cracked, and the only benefit of it allowing easier modfication of keys does not exist in this case too since it is not a server-sided file.
You should instead have keys implicitly set inside ur program, so it cannot be easily cracked
(note: keys ar not serial number, there should only be few keys, less than 10, thus there won't be any problem implicitly having them inside a program)


[side note]
if u ar thinking of using txt to store all encryption information for the purpose of clearity and being organize, a suggestion would be create a class in ur program that stores all encryption information instead, it will be just like how u wanted ur txt file, it will have keys, formulas, encryption,..., etc. Using a class as if it's a text file can do the exact same stuff that u ar planning with txt file, not only that, encryption information is implicitly stored inside a program, thus remain good security behaviour.



最後編輯: 1022292057 : 2008-4-11 11:36 AM
頂部

mickeyGoUp     Rank: 7Rank: 7Rank: 7
版主
性別 男
UID 5

精華 0
帖子 35511
積分 5235   詳情

閱讀權限 150
註冊 2006-3-24
來自 美國滴滴尼
狀態 離線

 
 
 
 
發表於 2008-4-11 10:32 PM  資料  個人空間  短訊  加為好友 
lhy, What does it mean by "the nth root number of..."?

numbie, seems like the heart of this machanism is the key generation and encryption/decryption process?  The rest are just typical validation process I guess.  

What encryption formula are easy to do but decent enough so it won't be cracked easily?

頂部

lhy     Rank: 3
青出藍
性別 男
UID 14043

精華 0
帖子 121
積分 330   詳情

閱讀權限 40
註冊 2006-10-16
來自 Netherlands
狀態 離線

 
 
 
 
發表於 2008-4-12 12:03 AM  資料  個人空間  短訊  加為好友 
nth root = http://en.wikipedia.org/wiki/Nth_root

easily be cracked?   ask microsoft.... they have plenty of exp. with this.
isnt it a good idea to make a real thing out of this?

頂部

快速美言
           


當前時區 GMT+8, 現在時間是 2024-11-23 07:08 AM

    Powered by Discuz!  © 2001-2007 Comsenz Inc.   
Processed in 0.021093 second(s), 7 queries

清除 Cookies - 聯繫我們 - LIPS Corner 新天藍 - Archiver