Encrypt/decrypt same file with two different passwords

Hi everyone:
I'm quite new to Java and cryptography in general and have a theoretical question. Is the following scenario possible and how would it be implemented:
Two users with two passwords (say, a regular user and a superuser) encrypt, decrypt, read from and write to the same file. The secret key for encryption and decryption should be based on their passwords (generated from their passwords), i.e. not stored anywhere on the system.
I've been racking my brains but can't think of a way. Am I missing an obvious solution?
Can it be done?
Thanks,
Michael

I don't think you can avoid having more than just a password hash stored on the system. Using a combination of my approach and Jeff's approach I can implement this as long as you allow a password protected key store to be stored on each system. A given user's key store would contain his RSA private key and associated public key together with the admin user's RSA certificate (thought the admin user's public key could be stored in the program since it does not have to be kept private). The admin user's key store would contain only his RSA private and public keys.
Assume that the data file is to be create by a standard non-admin user. His code performs the following actions -
1) Generates a random symmetric algorithm key. Say a 128 bit AES key.
2) He write a digest of this to the output file.
3) He writes the random key encrypted with his public key to the file.
4) He writes his public key (or certificate) to the file.
5) He writes the random key encrypted with the admin users public key to the file.
6) He encrypts the data using the random key writes the result to the file.
This user can then update the file by
1) reading from the file the digest of the random key.
2) reading the random key encrypted with his public key.
3) Decrypting this encrypted random key using his private key extracted from his keystore.
4) Check the digest of this key to make sure he has the correct random key.
5) skipping his certificate and the random key encrypted using the admin user's public key.
5) Decrypting the data using the random key.
6) Update the data.
7) Re-encrypt the file as described in the first part using a new random key.
The admin user can
1) read from the file the digest of the random key.
2) skip the random key encrypted using the user's public key.
3) reading the user's public key from the file (for use later if the file needs to be updated).
4) read the random key encrypted using the admin's public key.
5) decrypting the random key using the admin's private key obtained from his key store.
6) check the digest of the random key to make sure it is correct.
7) decrypt the the data.
The admin can edit the data since he can re-encrypt the data in a similar manner to the way it was created in the first place.

Similar Messages

  • Can Same IDOC be sent to same Receiver with two different Message Mappings

    Hello Experts,
    Wierd doubt but want to confirm from you people.
    Scenario:
    One R/3 Sender
    SAP XI :
    One external Receiver :
    IDOC is sent from R/3 to external receiver via SAP XI.
    One interface has already been developed for the above scenario.
    Now client wants another interface to be developed for the same IDOC. Might be the values would be different for some specific fields.
    Doubt:
    Is it possible to send one similar IDOC to one target system with two different Message Interfaces?
    Ex: Created Message Interface 'A'  and correspoding Message Mapping with an IDOC
          Created Message Interface 'B' and correspoding Message Mappingwith an IDOC
    Values would be different in the IDOC and would be triggered from SAP R/3. Basing on the specific value of a field in the IDOC , can we trigger a different Message mapping for the same receiver?
    I donot see any reason in developing a new interface for the same IDOC but as per the situation mentioned above, can it be done?
    Thank you
    Alex.

    Create two interfaces for target side.
    If you want only one target interface should get data.
    You can use simple interface determination. Use the condition tab and specify the field there but the value should be constant. e.g. if field has value EN it should go to First interface and if Field has value != EN it should go to second interface.
    If you want to divide your message in to both target interfaces.
    Multimapping also can help but only if both of your target interface need idoc data.
    You can use ifexist standard node functions from UDF to choose between the field.
    For multimapping you can go to messages tab in the message mapping and can add interfaces using + sign.
    then when you see the design part you will see two messages.
    Now Start with receiver determination in ID and create one receiver determination for the sender and receiver, this shows you have only one receiver.
    In interface determination you have to choose extended and choose your mapping designed.
    then both your interfaces automatically would appear.
    Create two receiver agreements and one sender agreement.
    thanks
    hemant
    Edited by: Hemant on Aug 28, 2008 12:29 AM

  • Displaying same field with two different selection criteria.

    Post Author: spulkundwar
    CA Forum: Crystal Reports
    Hi All,  i want to display list of product in two different table having life counter field less than 0 and life counter field greater than 0. The product list is grouped by product category. The report should look like as shown belowProduct Category1                                             Soon expired (Life 0-25)                                                        Expired Products (Life < 0 )                            Product Name  Product Life                                                        Product Name    Product Life                                     Coke                            24                                                                        Pepsi                    -2                                    Beer                           12                                                                          Vodka            -34 Product Category2                                  Soon
    expired (Life 0-25)                                          Expired
    Products (Life < 0 )
                                Product Name  Product Life       
                                     Product Name   Product Life
                                 Pepsi                    14             
                                           Coke              -2  
                             Beer                     2                
                                          Vodka            -34
    Is this possible to show two tables in each report row? When i set selection formula to product name, it sets the same selection formula to all the fields in the report.

    Post Author: pvierheilig
    CA Forum: Crystal Reports
    Hello -
    Can't you set the group to be on the category?  Selecting the product name in the record selection formula will present only those product (as opposed to categories).
    A subreport, as suggested, will work as well, but your stated record selection will continue to produce the same results - check that, too.  Additionally, you could group on the category and add a group 'b' section (Section Expert; see the Help file).

  • How to keep same database with two different names in SharePoint 2013 for two different applications

    Hi All,
    I have very strange situation.
    I had SP2010 production database(wss_content_contoso) migrated to SP13 few months back to migrate one site collection only while I have 15 site collections stored in this database and created a site contoso.com
    Now, I want to migrate same(wss_content_contoso) SP2010 database to SP13 and want to create contoso2.com.
    I changed database name from wss_content_contoso to wss_content_contoso2 and assigned newID during mount process.
    After this exercise, I don't see any site for contoso2.com and issue seems to be the same database. 
    My question is!!!!
    How I can keep both databases(actually same database with different names) and run both application simultaneously?
    Any help appreciated!!
    Thank you,
    AM
    AM Senior SharePoint Consultant

    You need to run Backup-SPSite/Restore-SPSite on each Site Collection you want to 'duplicate'. You cannot restore the same Content Database to the same farm as the Site Collections have the same GUID, which is stored globally for the farm.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • TS2972 I have multiple libraries on the "same computer" with two different desktops, can't I share between two libraries on the same computer?

    I'm trying to use home sharing to share content between libraries so some of the combined content in a given library, can be synced to an ipad.   Instad of having mulitple computers, i have multiple libraries on the same computer using two desktops.  How do I share within the same computer?

    iTunes must be running for home sharing to work.  There is no way to have home sharing running simultaniously for two users on the same computer.
    Simply add the media files using File > Add File/Folder option in iTunes.

  • Elements 9 has stopped printing-photopaper comes out untouched.  Same problem with two different pri

    Photoshop Elements 9 was printing great.  I hooked up new Canon Pixma 9000 printer and it worked great for about 20 prints.  Spontaneously quit putting an image on the photopaper.  Same problem with my Epson Artisan 810, so I assume it's an Elements 9 problem.  Seems like it's not transmitting an image to the printer(s), but is sending the command to cycle the paper.  I'm using a 4 year old MacBook with OS 10.6, and it worked fine for a long time.  Still prints with iPhoto.
    Anyone have any suggestions???
    Obie

    My inclination is that it is something in the projects or in the manuals being linked that is the culprit because that is where the consistency lies - projects were created identically and manuals all follow identical formats. The problem typically only occurs after the project has been successfully created and the manual is subsequently updated and I am syncing the manual in RH so I can generate a new AIR file. This is the first time the project has consistently corrupted every time I try to generate the Word document after linking it in RH. This makes little sense to me since it generated fine a couple weeks ago and I did nothing special when I updated it in Word yet when I tried to update it in RH, that is when it originally corrupted. The bottom line is that I cannot 100% trust that any project I run will work the next time. I end up just crossing my fingers and hoping for the best.
    My problems seemed to start once I went to RH9 (from RH8) because we had upgraded from MS Office 2003 to the 2010 version and I needed 9 for the docx extension. Like I said, it is not all the time - I can be beating my head against the wall getting one of the projects to work, then create 3 more projects that have no problems and then the next one leaves me wanting to throw my PC through a window....
    Deleting the CPD does not corrupt the project, it just removes my default linked document that allows me to circumvent linking the styles individually for that project. Once I have a manual linked and I remove the CPD, it just creates a new one. What I am saying is that if I delete the CPD file, it does not prevent the project from corrupting nor does it make the corrupted project viable again.
    thanks!
    Kathi

  • Dreamweaver won't open same file in two different folders.  Fix or switch to Aptana?

    Same file copied between 2 folders. DW will open one but not the other.  Copied code from 'good' file to new file; saved in 'bad' folder.  DW opened the file once then the spinning wheel of death again.  All files open in Aptana, Coda, Sublime no problem.  'Bad' file was coded and FTP's previously without problem.  Was annoyance previously but not the problem is becoming acute.  'Bad' file opens on Windows7 with DW8; won't open on MAC CS6.  Tried every fix posted; still POS.

    BTW - this has been a problem for years (plural).  I just had accepted that DW did this sometimes.  I write a lot of PHP so DW is not my primary software.  Couple of days ago, I was doing a customer presentation and it did it again.  MY mistake was I copies the development folder to a new folder and upload/took the approved site live.  Literally, I could navigate back to the old folder and open index.php but it would not open in the new folder.  Copied the old contents to the new folder/file, saved it, opened it and it worked fine.  This whole time I am tap dancing in front of a room full of people.  Go back to reopen the file and no go.  As my face slowly turns bright red, I navigate back to my development folder to open index.php.  Surprise, now it won't open either.  Luckily for me, I had a copy of Coda2 on my laptop, switched over and sold the job.  I mainly use DW for customers where I can split screens - use an 80" presentation screen - for convenience.  Was thinking about upgrading from CS6 but 4 and 5 had the same problems which was why I went to 6.

  • How can I make waveform graph and/or excel file with two different dynamic DBL values?

    As the question describes, I have two dbl sources from a load cell and linear actuator (from firgelli). I want to make a load/displacement curve from the force readings from the load cell and the displacement readings from the linear actuator. The load cell outputs an analog signal that can be acquired by a DAQ and the actuator comes in with a board and VI program to control the speed and measure the displacement of the actuator to a sample rate of my choosing. Is there a way that I can make a VI where it continues to collect data and construct the graph I'm looking for?
    Solved!
    Go to Solution.

    A couple points about your application:
    1.  Synchronization.  Since you're ultimate goal is a stress/strain curve, it is vital that your force and displacement data be synchronized appropriately.  If your sampling is beyond a few times a second, this is not really possible without some form of hardware synchronization via either a trigger and/or sample clock.  Two NI DAQ boards can be synchronized this way easily, but it seems you're using 3rd party hardware for one of these processes.  Would need to know more about that board to know what options you have.  You could specify what your resolution is in distance, and how fast the article will be moving, to get an idea of how fast to acquire, and how well you'll need to synchronize the data.  Another option, since it appears each data stream will be sampled on a hardware-timed sample clock, they will be offset in time, but not skewed during the acquisition.  You may be able to identify a feature in the data set common to each and use that to remove the timing offset after the process is completed.
    2.  Display.  To display data during the acquisition process, I usually recommend at least one display that plots vs. time.  Much easier to spot irregularities with the acquisition process that way.  However, if you'd like to also plot force vs. displacement, you can use an XY Graph to plot parametrically. For Example, in your case you would use the Displacement data as the X coordinates, and the Force data as the Y coordinates.
    3.  Saving data to file.  I would recommend using the Save to Spreadsheet File.vi (File IO pallette) to save your data.  If you use a comma as the delimiter, and save the file with a *.csv extension, you will have a file that is easily read into excel.  The standard tab-delimited spreadsheet file is also fine, it will just require an extra step to read it into excel to specify to excel what the delimiter is.
    4.  Batch vs. Real-Time Recording (Data File).  If your process is short (< 30 sec) you may be better off acquiring the data, Storing it locally to the VI (Array - usually maintained in a shift register), and then writing the file with a header (acquisition parameters, test article information, data column headers) and the data all at once in batch mode to the file after the process is finished.  If, however, it is longer than that you would be better off starting a data file with a header and appending the data to the file as you go, so that if something happens during your test, you at least have data up to that point.
    Hope this Helps,
    Kurt

  • Can two people use the same computer with two different ipods?

    I was just wondering if me and my mother can use the same computer with our ipods?

    Glad you asked. Before you get rid of the old one move its iTunes Library to the new one:
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/HT4527
    "Deauthorize" the old computer too. Go to the iTunes Store menu and select "Deauthorize This Computer..."
    I hope you get a Mac this time

  • If I open the same document with two different apps on my iPhone does the document get saved twice?

    For example, I chose to open a .pdf document I received as an attachment with Adobe Reader or iBooks, and now the document is available anytime I open Adobe Reader or iBooks. My question is if these applications are able to open the document anytime they want then the document must be available somewhere on the device, where do they get saved? And do they get saved twice if I opened the same document once with iBooks and once with Adobe Reader?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Do a malware check with some malware scanning programs on the Windows computer.<br>
    Please scan with all programs because each program detects different malware.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender: Home Page:<br>http://www.microsoft.com/windows/products/winfamily/defender/default.mspx
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • How to display same screen with two different options!!

    Hi All,
    I have created a new entry form where user can enter a new record by selecting from combo select list or manua entry text fields. The same screen has to be used in two ways.
    New entry screen. and once user enetr data clik on sumbit it will insert into database.
    But when the user click on "View" button i need to display the same screen but with existing data insted of empty fields.
    How to achieve this in teh same screen, insated of creating duplicate screen.
    Thanks,
    Anoo..

    Hi,
    Try to use form on a report with report on page 1 and form on page 2.
    When the user clicks edit icons he will be directed to page to to see the values that are entered, make sure form is not updatable.
    If the user clicks create from page 1 then he will be directed to page 2 where he can enter data to insert new record.
    If you need in more detail, explain the scenario how you want, so that I can create an example for you.
    Thanks,
    Ramesh P.

  • What To Do To Be Able To Use Same Files on Two Different PCs.??

    I need  to tell each PC that the files are related, since Dreamweaver writes internal code for each file?
    What do I need to do?  The computers are NOT on a network.
    I hope I a clear with my question.
    Cheers,
    Dreamweaver101.1

    Ok,
    I want someone to do some work for me using Dreamweaver 8 at their home.
    My license allows me to use at least 2 computers.
    If they format content for me using my template, I want to be able to upload these file to my web site?
    Are you saying unless they are on a network,  this arrangement (working at different locations)  will NOT work?
    cheers,
    Dreamer101.1

  • Is there a way to associate the same song with two different albums?

    Here's what I would like to do if it's possible. I recently purchased Mothership, the Led Zeppelin compilation album. That album has about 4 songs from Led Zeppelin 4. I'm hoping I could purchase the remaining songs from Zeppelin 4, then somehow copy the 4 songs from Mothership over and associate them with Zeppelin 4 to complete the album, yet still keeping them as a part of the Mothership collection. I don't really want to re-purchase those 4 songs again. Is this do-able?

    Hello - What I would do is this: (forgive me for being thorough..) And this would ony work with physical store-bought CDs:
    1) insert cd & wait for iTunes to open;
    2) then, close iTunes
    3) double-click on the cd icon, figure out which track(s) you want, then select them & option-drag to make a copy of them on the desktop.
    4) IF iTunes already "named" the songs, click on each song and change the name to something else (i.e. track 01 or whatever)
    5) drag this "nameless" track into iTunes and then drag the songs into the playlist where you want the duplicate of the song.
    6) now that the nameless song is in the new playlist, go ahead and give it its correct name, artist, album, etc.
    I think this should work. Forgive me again for being overly simplistic. Hope it works.

  • Split valuation for  material with two different price indicator S and V

    Hello Gurus,
    Is it possible to maintain split valuation for same material with two different price indicator S and V.
    For Ex. Material A is manufactured can be manufactured in house ,  procured from outside vendor and can be purchased from subcontracting vendor by providing raw material.
    We want to keep  Price control V for same material " A"  which is procured from outside vendor.
    And price control S for inhouse produced same material " A".
    Besically this material is semifinished and having BOM for subcontracting.
    Please advice.

    Hi
    When the material is split valuated, you maintain the accounting view for the material 1st with valuation category, here the price control should be V.
    When you will extend the material to valuation type "Inhouse mfgd" maintain the price control as S, for valuation type "Procured form outside vendor" maintain it as V.
    Regards
    Prasad

  • Open the same raw file in PS5 with two different White Balance settings

    I'm trying to open the same Raw File in PS5 with two different White Balance settings.  One setting "as shot" the other in "daylight", then blend them.  The tutorial I'm watching says to "stack" the images.  The tutorial shows one White Balance setting as the "Background" layer and the other setting as "Layer 1".  I don't know how to do this and the tutorial is not specific.  Can anyone either point me to a step by step instruction or offer some assistance?

    Also look at the "Snapshots" feature of Camera Raw itself.  It allows you non-destructively to keep multiple sets of settings for a single raw file.
    Learning about it far exceeds the scope of what can be done in this particular forum.  I would recommend this book as essential reading:
    http://www.amazon.com/Real-World-Camera-Adobe-Photoshop/dp/0321713095/ref=sr_1_1?ie=UTF8&q id=1313502199&sr=8-1
    Additionally, there's a dedicated Adobe Camera Raw forum:
    http://forums.adobe.com/community/cameraraw
    Wo Tai Lao Le
    我太老了

Maybe you are looking for

  • Age analysis for customers and vendors

    Hi All, i needs to create an age analysis report on customers and vendors (0FIAR_C03), analysis could be done on <30 days, >30 days,>60,>90,>120 days , i needs to calculate these based between netdue date for payments and system date. any one can giv

  • What download is good for Firefox 33 for silent install for windows os?

    In fire Fox 33 download we see there is setup stub .exe , when will setup.exe for firefox 33 be available as we cannot do a silent install for setup stub.exe . we have no issues in doing silent install for setup .exe which we had for previous version

  • Strange red box in canvas

    i was trying to make a freeze frame in a project earlier and when i went to drag the frame on to the timeline up came a red box in the canvas which read " Codec not found: display unavailable. select different coded using sequence settingings and clo

  • Bridge not opening after install

    Just downloaded Bridge, LR5 and PSCC.  When trying to open Bridge, get error message 'could not complete operation'.  Other downloads seem to open fine.  Using MacBook Pro, new, with Maverick 10.9.1.  What to do?

  • Standby Applied Archivelog Automatic Deletion

    Dear OTN Community, My Oracle version is 10gR2 and OS is HP-UX v11.31 My question here is i have configured the archivelog deletion policy from none to APPLIED ON STANDBY on the standby database since we are taking backups on the primary database. I