IV and hmac from shared secret, and replay attacks.

Hello all!
I am working on a client server project where i use the diffi-hellman keyexchange.
both server and client has the secret and can decrypt enc messages from eachother.
Q1:Up to now i have only used a predifiened IV for the 3des cbc cipher. But I would like to generate a IV from the shared secret somhow. Which way is the most secure way to do that?
the way things look now i enc/dec by my self whithout the cipheroutputstream, (got to much trouble whith the cipherbuffers) and just send it over by my self.
I would like to use a SHA1 hmac and send that over whith the msg.
Q2: I now use println for sending, is it ok to first send the enc msg, and then send the hmac after, from security point of view?
Q3: how do i use my shared secre to calculate a sha1 hmac from the msg?
Q4: how do i use a timestamp whith the above cipher and hmac in a secure way to prevent replay attacks?
Sry for the many questions, I have tried for several days to figure some of this stuff out, any help/code is appreciated
/Mike

Bossk wrote:
Thanks for your reply.
I've read most (if not all) .net to java migration threads I could find. None helped me with my problem.
If I understood your reply correct, there are some fundamental flaws in the .NET encrypt/decrypt routines:Yes but I am not aware of any in the code you are using.
>
- the AES blocksize is set to 256 but can only be 128 bitsYour .NET code is using Rijndael which does allow a block size of 256 but your Java code is using AES which does not allow a block size of 256. You need to get a Rijndael implementation from another provider. I suggest you look at BouncyCastle. They may also have an Rfc2898DeriveBytes port.
- ECB mode is used. However, ECB does not use an IV, right? So the .NET classes must be ignoring this parameter.Yes. What I find interesting about the .NET crypt routines is that they (almost) never throw exceptions when illegal or inappropriate parameters are used.
>
I also have the PasswordDerivedBytes class from the thread you linked, when I try to decode using this code it still does not work:.NET class PasswordDerivedBytes is a mess but you actually need an implementation of RFC2898 some of which PasswordDerivedBytes implements. Check with BouncyCastle provider they may have an Rfc2898DeriveBytes class but if not then you need to implement the relevant part of RFC2898. The problem you will have is knowing which of the 5 RFC2898 key generation algorithms is actually uses with the .NET code.

Similar Messages

  • Sub-admins, Shared Secret, and Automated Podcast Upload Access

    Before the questions, the context:
    Here at Iowa State, we've set up "sub-admins" for each of the colleges by managing an exceptions list. In this way, the sub-admins can create new courses from templates and help faculty upload content, but within their college area only. In addition, faculty automatically have upload access for their course(s) if the identifier is set up correctly by the sub-admin.
    However, some of these sub-admins have asked for the secret question so that they can use their lecture capture package (and not the package supported by central IT (Echo 360)) to automatically upload course content.
    As we all know, the secret question is the key to the site, circumventing any sub-admin access we've granted them, and essentially giving them full admin rights.
    So, my questions are:
    1. How are all of you handling the creation of new courses and content? That is, are all courses and other content created by one central person/office, or is the responsibility for creating and managing content shared among similar sub-admins?
    2. If you have sub-admins, what is your policy for giving out the shared secret for the purposes of these packages?
    3. Is there any way to allow these podcast creation packages the ability to auto-upload without handing out the shared secret?
    Message was edited by: ISU iTunes U Admin
    Message was edited by: ISU iTunes U Admin

    My suggestion is that if you use Apple's time server (time.apple.com), then if Apple has the wrong time, your local time setting will be wrong by an equal amount. It's pretty unlikely that Apple's time server(s) will be off…but if they are, you're covered because the time stamp that you generate locally and the time stamp that Apple generates remotely will derive from the same source, whether or not that source is actually "correct" in an absolute sense, then, won't matter.
    You are correct that Woolamaloo uses the local time of your Mac/PC. But if your local machine and your web portal machine time sync from the same time server, then they could be equally "wrong".
    Another thing that I mentioned earlier is that all timestamps are measured from UTC or "Greenwich" time. So if your portal server/desktop machine isn't configured correctly for location, this will not be taken into account when your timestamps are generated. For example, I live in Chicago, which is currently under Central Daylight Time in the USofA. This means I'm UTC-5 hours, if memory serves. If I move to, oh, Duke University, but forget to change the locale on my computer, then my computer will continue to think that I'm UTC-5 when I should, in reality, now be UTC-4. So if you find that your timestamps are off by an exact number of hours, then it's a sure bet that your machines aren't setup correctly for their locales. Make sense?

  • Has anyone experience with Shared Secrets and Time Machine?

    I'm using Shared Secrets password manager. I'm trying to get it from my time machine backups on my new (secondhand though) mac.
    But... it shows up as an empty version. I'm dreading having lost all my passwords...
    Has anyone good advice please?

    According to the information on this page the required Aircard 580 card is NOT compatible with any version of the Mac OS. Which is really odd since the banner across the top of the page proclaims "wireless, mobile web access for your mac". Perhaps they intend for you to buy a compatible phone and use Bluetooth connectivity to allow the phone to act as a modem for your Mac.
    The built-in wireless of your Mac does not allow you to connect directly to cellular networks like BlueMobility.
    After some more digging... I found this page which supposedly lists the Mac compatible options.

  • A base URL and shared secret - when dio you get these?

    My boss is the administrator for our universitys iTunes site. We are not public yet. I aked hime for the base URL and shared secret code adn he said he never got them. So when do we get them? We need them to program the API. De we need to set the site to "Borwse" to have them sent?
    If they were sent and lost can they be re-sent?
    Thank you,
    Chip

    Chip,
    If students, faculty, and staff can get to your site through a portal ... if your boss can access your site as an administrator, then there is no way that Apple did not send those strings to you. On the other hand, if you have never, ever accessed your iTunes U site, then it might be possible that you never generated site strings and your boss could very well be correct.
    Generally speaking, when you get a new iTunes U site approved, Apple sends the e-mail address listed on your school's application a "welcome" e-mail that contains a link that opens iTunes and shows you your site strings. If you don't have your admin credential handy, you can always return to get a copy of those strings, but only if you've previously associated an iTunes U administrator with an Apple ID (an Apple ID is the same ID you'd use, say, to buy music from the iTunes Store itself).
    If you no longer have that welcome e-mail or your site strings, you can ask that Apple resend that welcome e-mail ... and the best way to do that would be to contact your local Apple account executive or Apple service engineer and arrange it through them. If you don't know to whom you belong, we can help you find out.

  • How do I remove/prevent a random and unwanted PC from "sharing" my Mac?

    Whenever I go to save a paper that I am working on, on the left hand side of the save menu there is an area labeled "Sharing." Underneath this title there is a Dell that is evidently sharing my information. I do not know this person and I do not know how they got connected to my Macbook. Is there anyone who knows how to remove this person from "Sharing" my information?

    The Dell has file sharing enabled, so it is advertising its services.  Mac OS X has seen that Dell is a file server and is allowing you to choose the file server if you desire.
    The Dell knows nothing about you or your Mac except what you may be advertising via System Preferences -> Sharing.  If you do not share anything, then the Dell will only be able to see your Mac as an IP address on the local network.
    If you do not want the Dell to share files, then configure the Dell to disable its file sharing.  Or just do not select the Dell as an output destination.

  • How do I stop all my contacts and photos on my  iphone from sharing with my ipod

    How can I stop my contacts and photos on my iphone from sharing with my ipod?

    Go to Settings>iCloud and turn off Contacts and PhotoStream. Note that will off yo will not be able to add contacts on that iPod.. Also note that with Calendar and Notes are on those items will sync between the two devices.

  • Accidentally removed from,sharing and permissions the admin user,and now i do not when i find the home icon at my computer i do not have permmission,and the mac does not works properly,lots of question mark at the dock ,please help

    accidentally removed from,sharing and permissions the admin user,and now i do not when i find the home icon at my computer i do not have permmission,and the mac does not works properly,lots of question mark at the dock ,please help

    I'm going to assume that since you deleted your hard drive and all its files, you had a backup, yes? If the backup has an OS (bootable clone), then you can boot into it by holding down the option key when you start up you iMac and choose the backup drive. Then use Carbon Copy Cloner or Super Duper to copy the files back to your iMac.

  • HT2731 I have 2 iPhone 4's in my name.  How do I stop from sharing my photos from one phone to the other.  When I take a photo it shows up on my husbands phone and vise versa. We have our iCloud turned off

    I have 2 iPhone 4's in my name.  How do I stop from sharing my photos from one phone to the other.  When I take a photo it shows up on my husbands phone and vise versa. We have our iCloud turned off in both phones.

    well i think one of you should change yalls name on the iphone its may not be the icloud but the names

  • HT204385 how do i remove my computer from shared i tunes acct, and set up my own?

    i need to remove my computer from shared i tunes account and set up my own. how do i do this?
    or if i deauthorize  my computer from that i tunes acct will i be able to set up i tunes acct?

    Create an Apple ID for your son...
    Sign out of your account and get him to sign in with his new account...
    Bear in mind that any Apps Purchased with your ID will not be able to be Updated with his ID...
    The Apps are locked to your ID...
    Apple ID FAQ
    http://support.apple.com/kb/HE37

  • Changed the Shared Secret, and now VPN doesn't work...

    Hello all. So our VPN was working fine. I changed the Shared Secret, and it stopped working. Seems like any Shared Secret now that I use doesn't work, and I've been triple-checking it on both the server and clients to make certain that it's not miss-typed.
    It seems to connect OK, but then it fails to authorize. I've got the proper ports open, and again, it worked just fine with the first Shared Secret I used.
    Is there something I'm missing about Shared Secrets here? You should be able to change them when you need too, right?
    Message was edited by: Jeffrey McGrew

    Looking at the logs I'm seeing something strange that I don't understand. It appears that one part of the authorization is succeeding, and another part failing:
    "DSAuth plugin: Could not authenticate key agent for encryption key retrieval."
    Then, two lines later:
    "CHAP peer authentication succeeded for USER"
    "DSAccessControl plugin: User 'USER' authorized for access"
    But then the client never shows that it's authorized. So is this a problem with the client configuration, since the server is showing an authorized session starting, or is there something wrong with the DSAuth Plugin?
    (going to read more PDFs)

  • I want to buy the new iPod Nano to play audiobooks. Does it remember the postion where switch-off took place and resume from there? Can one rewind and replay freely?

    I want to buy the new iPod Nano to play audiobooks. Does it remember the postion where switch-off took place and resume from there? Can one rewind and replay freely?

    1. Many thanks! I look forward to your revert on being able to freely rewind and replay with the 7th Gen iPod Nano.
    2. Re resuming from the position where one left off - I meant after switch-off and not merely pause. Often, with audiobooks, I have to stop for the day, and resume maybe after 1-2 days. I'll be grateful if you can check this too
    3. The above features make the iPod Classic a joy to use, but I have reservations about using it on walks because of its HDD.
    4. Greatly appreciate the trouble you are taking. Best regards.

  • HT1689 On the new version of  iTunes the shuffle button and replay buttons appear to have disappeared on the genius tab and am always having to listen to shuffled songs now :( how can I stop this?

    On the new version of  iTunes the shuffle button and replay buttons appear to have disappeared on the genius tab and am always having to listen to shuffled songs now :( how can I stop this?

    It appears from many other posts that the " Keep This iPod in the Source List" function isn't included in iTunes 7 unfortunately. You can leave your feedback on it's absence at this link: Apple Product Feedback
    You can check out a workaround at this link which may help out for now: Create ready-to-sync playlists for Shuffles in iTunes 7

  • Adding Pause and Replay Buttons

    Ok here is my script for an external XML loading Flash
    Gallery...
    1. How do I add a "constant" Pause and Replay on this?
    2. Every time I add something to the stage the "fade effect"
    affects that too!
    Thanks in advance.
    delay = 5000;
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    image = [];
    description = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) {
    image
    = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
    description
    = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
    id = setInterval(preloadPic, 100);
    } else {
    content = "file not loaded!";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("images.xml");
    var loadTot = 0;
    var k = 0;
    function preloadPic() {
    clearInterval(id);
    var con = picture.duplicateMovieClip("con"+k, 9984+k);
    con.loadMovie(image[k]);
    var temp = _root.createEmptyMovieClip("temp"+k, 99+k);
    temp.onEnterFrame = function() {
    var total = con.getBytesTotal();
    var loaded = con.getBytesLoaded();
    percent = Math.round((loaded/total*100)/image.length);
    preloader.preload_bar._xscale = loadTot+percent;
    info.text = "Loading picture "+k+" of "+image.length+"
    total";
    if (loaded == total && total>4) {
    con._visible = 0;
    nextPic();
    loadTot += percent;
    delete this.onEnterFrame;
    function nextPic() {
    if (k<image.length-1) {
    k++;
    preloadPic();
    else {
    firstImage();
    preloader._visible = 0;
    info.text = "";
    listen = new Object();
    listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
    prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
    nextImage();
    Key.addListener(listen);
    previous_btn.onRelease = function() {
    prevImage();
    next_btn.onRelease = function() {
    nextImage();
    var p = 0;
    var current;
    MovieClip.prototype.fadeIn = function() {
    if (this._alpha<100) {
    current._alpha -= 5;
    this._alpha += 5;
    } else {
    current._visible = 0;
    delete this.onEnterFrame;
    function nextImage() {
    if(p<(total-1)){
    current = this["con"+p];
    p++;
    var picture = this["con"+p];
    picture._visible = 1;
    picture._alpha = 0;
    picture.onEnterFrame = fadeIn;
    desc_txt.text = description[p];
    picture_num();
    slideshow();
    if (isPaused == true) {
    current = this["con"+p];
    p<total-1 ? p++ : p=0;
    preloadPic();
    function prevImage() {
    if (p>0){
    current = this["con"+p];
    p--;
    var picture = this["con"+p];
    picture._visible = 1;
    picture._alpha = 0;
    picture.onEnterFrame = fadeIn;
    desc_txt.text = description[p];
    picture_num();
    function firstImage() {
    con0._visible = 1;
    con0._alpha = 0;
    con0.onEnterFrame = fadeIn;
    desc_txt.text = description[0];
    picture_num();
    slideshow();
    function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
    function slideshow() {
    myInterval = setInterval(pause_slideshow, delay);
    function pause_slideshow() {
    clearInterval(myInterval);
    if (p == (total-1)) {
    //Resetting...fadeout=300 milliseconds.
    endFadeOut = setInterval(fadeOut, 300);
    //Try using a movie clip called restart_mc that is a button
    _root.attachMovie("restart_mc");
    } else {
    nextImage();
    Here is the Source Files:
    Download the
    Sources

    anyone?

  • Capture and replay

    Hello!
    Our application has 3 layers:
    - Flash
    - Java
    - Oracle PL/SQL
    Java layer is basically a bridge between flash and oracle. Our servlet container is the Tomcat. What I would like to do is capture all the events on java layer to replay automatically every day and make some functional tests.
    There is or do you know any tool to capture and replay java events on tomcat?
    I appreciate your answer.
    Thanks a lot
    A.

    JMeter can read a log file and create a script that executes the same requests as the log file mentions. Then you can add checks/assertsions. This can be used for some simple Testing.

  • Capture and replay program function

    Hello,
    I want to implement in my program something like a primitive capture and replay functionality.
    But I have no idea how to start.
    I found out about awt.robot which I think is good for replay, but upto now I have not found anything for the capture part.
    I think that my main problem is, being not very experienced at all, I just don't know where to look.
    I appreciate any sort of hint where and/or how to investigate further.
    Please, help me!
    Thank you!

    Hi working Kevin,
    thank you very much. I believe this is the right direction.
    But probably it is not enough to get what I want.
    What I try to do is write a program which can be used to automate procedures on my PC including manoeuvering through the Windows GUI and also other applications. (I know that there are affordable tools to this, but I take this as a JAVA learning project and I really want to find out how it is done)
    I believe the event listeners work only on my own application's components, isn't it?
    (And now I find out how to assign these Duke Stars)

Maybe you are looking for

  • What are the equipment required for VC

    Our requirements are something like this :- We have 3 locations. 2 locations (locationA and locationB) are connected with Fiber optic link and the 3rd location (locationC) is connected with 1mbps wireless link to locationB. - In LocationA we need 10

  • Handle single click event in ALV OOPS

    Hi, I have to display 2 ALV grid...one above the other. Top ALV will contain Header info and bottom ALV witll display line item. I am use ALV OOPS. Now when user will click on the top ALV ...bottom ALV should show corresponding data. I don't have to

  • Exporting entire

    I have the same question as in this message which is: Hi, Does anyone know how to export all the elements in the library of a flash file? i.e. Get all of the jpg's in the library into individual files? I was thinking something like using shared libra

  • About Assignment Operator!

    what difference between the code fragments below? fragment 1: int x=1; String y="Hello"; x=x+y; fragment 1: int x=1; String y="Hello"; x+=y; Fragment 1 cause compile error. Fragment 2 compile successfully.

  • Authentication by Openldap - How to change password ?

    Hi, I've Groupwise 7 with authentication by Openldap. I try change user password but not works. I need help... Have error ... D06B