Click here to Skip to main content
15,914,016 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: sizeof Pin
James R. Twine7-Apr-06 0:50
James R. Twine7-Apr-06 0:50 
AnswerRe: sizeof Pin
toxcct7-Apr-06 2:20
toxcct7-Apr-06 2:20 
GeneralRe: sizeof Pin
vikramlinux7-Apr-06 3:21
vikramlinux7-Apr-06 3:21 
GeneralRe: sizeof Pin
toxcct7-Apr-06 3:34
toxcct7-Apr-06 3:34 
AnswerRe: sizeof Pin
cmk7-Apr-06 10:24
cmk7-Apr-06 10:24 
QuestionCryptographic help Pin
Waldermort7-Apr-06 0:15
Waldermort7-Apr-06 0:15 
AnswerRe: Cryptographic help Pin
Ștefan-Mihai MOGA7-Apr-06 0:35
professionalȘtefan-Mihai MOGA7-Apr-06 0:35 
AnswerRe: Cryptographic help Pin
James R. Twine7-Apr-06 1:41
James R. Twine7-Apr-06 1:41 
   If you want to be able to encrypt using either the "User" or "Master" password, but want to be able to decrypt data encrypted using the "User" password with either the "User" or "Master" passwords, but prevent decryption of "Master" encrypted data using the "User" password, I do not know of a specific encryption algorithm that allows this.

   However, you may be able to do what you ask by encrypting the data with static static/internal passwords, and write a signature at the beginning of the data indicating if the "user" or "master" encrypted the data.  You can then use application logic to determine of the "user" should be allowed to decrypt the data.

   For example, you internally maintain two passwords: User-"ABC", Master-"123".  Data is encrypted depending on who saved it, and is stored with a flag indicating if the "User" or "Master" encryption was used.  At decryption time, you can read the flag, and determine if the current user is a "User" or "Master", and determine if you should decrypt the data or not.  For example, a "User"-level user is trying to read two units of data from the database, one saved with the "User" password, one with "Master".

   First, the data was saved with "User" is read back.  The data's flag is checked (which is "User"), and the current user is allowed to decrypt it (because they are "User" or "Master"-level), so decrypt the data.

   Now, the second set of data saved with "Master" is read back.  The data flag is checked (which is "Master"), and the current user is not allowed to decrypt it (because they only have "User"-level access), so you raise an appropriate message.

   A bit quick&dirty, but it might work for a Monday implementation... :/

   The most important thing to do when working with encryption, IMHO, is to clearly specify exactly what you need encrypted, and to what extent, then approach possible solutions.

   Peace!

-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites
(Please rate this post!)
GeneralRe: Cryptographic help Pin
Waldermort7-Apr-06 1:57
Waldermort7-Apr-06 1:57 
Answer[Message Deleted] Pin
ddmcr7-Apr-06 2:38
ddmcr7-Apr-06 2:38 
GeneralRe: Cryptographic help Pin
Waldermort7-Apr-06 5:49
Waldermort7-Apr-06 5:49 
Questionmulti column list box Pin
parichaybp6-Apr-06 23:49
parichaybp6-Apr-06 23:49 
AnswerRe: multi column list box Pin
Nibu babu thomas6-Apr-06 23:54
Nibu babu thomas6-Apr-06 23:54 
AnswerRe: multi column list box Pin
Hamid_RT7-Apr-06 0:09
Hamid_RT7-Apr-06 0:09 
AnswerRe: multi column list box Pin
David Crow7-Apr-06 3:01
David Crow7-Apr-06 3:01 
QuestionWindows Socket Communication Pin
kk.tvm6-Apr-06 23:48
kk.tvm6-Apr-06 23:48 
AnswerRe: Windows Socket Communication Pin
Ștefan-Mihai MOGA7-Apr-06 0:01
professionalȘtefan-Mihai MOGA7-Apr-06 0:01 
AnswerRe: Windows Socket Communication Pin
Nibu babu thomas7-Apr-06 0:02
Nibu babu thomas7-Apr-06 0:02 
AnswerRe: Windows Socket Communication Pin
Roger Stoltz7-Apr-06 0:02
Roger Stoltz7-Apr-06 0:02 
AnswerRe: Windows Socket Communication Pin
Hamid_RT7-Apr-06 0:25
Hamid_RT7-Apr-06 0:25 
AnswerRe: Windows Socket Communication Pin
Nishad S7-Apr-06 0:37
Nishad S7-Apr-06 0:37 
QuestionMFC ActiveX Controls Pin
Subramaniam s.V.6-Apr-06 23:37
Subramaniam s.V.6-Apr-06 23:37 
AnswerRe: MFC ActiveX Controls Pin
Ștefan-Mihai MOGA6-Apr-06 23:57
professionalȘtefan-Mihai MOGA6-Apr-06 23:57 
AnswerRe: MFC ActiveX Controls Pin
Roger Stoltz6-Apr-06 23:59
Roger Stoltz6-Apr-06 23:59 
AnswerRe: MFC ActiveX Controls Pin
Hamid_RT7-Apr-06 0:59
Hamid_RT7-Apr-06 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.