What Is Wrong With This Picture??

Hi All,
I have been working on an RSA encryption program that allows the user to enter a message 'M'.
This message undergoes a series of permutations based on two prime numbers that have been randomly generated in order to encrypt the message.
The message is then decrypted using similar calculations.
The problem is it only returns the correct value some of the time! I'm sure it has to do with the final calculations, because if I use a calculator to do the functions I get the expected result 100% of the time.
Can anyone solve this problem?
// Perform calculation on M to encrypt the message
     double cipherText;
     cipherText = (double) Math.pow (encryption[0], e) % n;     
     System.out.println("CIPHERTEXT = " + cipherText );     
// Decrypt the message
     double decryption [] = new double [1];
     double plainText;
     decryption [0] = cipherText ++;          
     plainText = (double) Math.pow (decryption[0], d) % n;     
     System.out.println("PLAINTEXT = " + plainText );

You don't need to use the BigInteger everywhere... you can create some convenience methods to replace the spots where the numbers get as large as you say and hide the BigInteger's existence from the world...Let's say like this:
public static int getCipherText(int codedChar, int exponent, int modulo)
  BigInteger theBigOne = new BigInteger(""+codedChar).pow(exponent).mod(new BigInteger(""+modulo));
  return theBigOne.intValue();
}and just use the metod everywhere...
HTH,
Fredrik

Similar Messages

  • Script debug - what's wrong with this picture?

    I wrote a script a while back which shrinks and saves out images in png format. Nothing fancy. It works fine. I am happy. However yesterday, I discovered that it baulked at a certain file. Initally I thought it was a problem with the script (and that may be the case - i'm still new to scripting) but it worked with every other image I've thrown at it. Ergo it must be something wrong with the image.
    Now here's the thing: I also noticed that adding a new layer underneath the existing single layer and then merging down allowed the script to work fine. So what is wrong with the inital image before it's had a new layer added and merged? Or what does adding and merging do to an image do to fix as I can't see any visual difference?
    Here is the bare bones of the script:
    // Set filePath and fileName to source path
    filePath = "C:\\temp" + "/" + 'debugme' + '.png';
    // save out the image
    var pngFile = new File(filePath);
    pngSaveOptions = new PNGSaveOptions();
    pngSaveOptions.embedColorProfile = true;
    pngSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
    pngSaveOptions.matte = MatteType.NONE;
    pngSaveOptions.quality = 1;
    pngSaveOptions.PNG8 = false;
    pngSaveOptions.transparency = true;
    activeDocument.saveAs(pngFile, pngSaveOptions, false, Extension.LOWERCASE);
    I would include the two psds (one that works and the one that doesn't) only this forum doesn''t seem to allow .psd files - and saving them out in another format is the whole problem.

    A quick test and this resolved the issue for me…
    #target photoshop
    filePath = '~/Desktop/Testing.png';
    // save out the image
    var pngFile = new File(filePath);
    pngSaveOptions = new PNGSaveOptions();
    pngSaveOptions.embedColorProfile = true;
    pngSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
    pngSaveOptions.matte = MatteType.NONE;
    pngSaveOptions.quality = 1;
    pngSaveOptions.PNG8 = false;
    pngSaveOptions.transparency = true;
    clearLayerStyle();
    activeDocument.saveAs(pngFile, pngSaveOptions, false, Extension.LOWERCASE);
    function clearLayerStyle() {
         function cTID(s) { return app.charIDToTypeID(s); };
         function sTID(s) { return app.stringIDToTypeID(s); };
              var desc01 = new ActionDescriptor();
              var ref01 = new ActionReference();
              ref01.putEnumerated( cTID('Lyr '), cTID('Ordn'), cTID('Trgt') );
              desc01.putReference( cTID('null'), ref01 );
         executeAction( sTID('disableLayerStyle'), desc01, DialogModes.NO );

  • Two "Libraries" - What's wrong with this picture. ?

    -
    "picture". —> http://www.proxigee.com/this_picture.png
    I've got two "Libraries".
    One at the first level. - main HD folder. And one with my main "Home" - level, folder.
    Not sure, how this happened, exactly.
    .. As best I can figure, I may have moved the one (original with machine) from the main HD level folder to my main "user"/ "home" level folder, ....
    .. and then, with this - subsequently, another was generated/ included, .. as part of a new OS installed ("Panther", to "Tiger".), done to alleviate a problem.
    My main question, can I / should I .... consolidate this two, different "Libraries".
    Of important note, .... in fact, I couldn't tell you - if asked and with not checking, just what [a] "Library" folder, contains/ or is "all about".
    (I'll be studying more.)
    Rm(richard583a)

    -
    hello Niel.
    Thanks.
    Appreciate your help.
    Perhaps you can help me with this idea following. (?)
    I've just copied my main "home" folder to an "external" HD, ... to do an upgrade, to "Leopard" — toward saving my main data/ apps, accrued to this point, to grab from.
    I've got an article which deals with the main process of upgrading. Should I copy (back up) anything else, for any reason, import . ?
    .. Essentially my reason for upgrading, is to alleviate a problem that "Disk Utility" .. can't fix, .. so I'm somewhat hesitant to do a "bootable" disk image, saved to that "external HD".
    Rm(richard583a)

  • Encoding 320 kpbs vbr = 320? what's wrong with this picture

    Hi,
    I notice something peculiar about encoding with iTunes at 320 kbps vbr.
    When getting info in iTunes on the converted mp3 file, it shows as 320 kbps. What’s peculiar about this is, setting the bit rate to 320 means 320 is the highest possible rate - when needed. The more silent parts of the audio file are going to be less; therefore I should be getting an average number, say 276. This occured with a batch of different songs, so it's not the audio files.
    As a test, I also use BarbaBatch and do not have this problem. I encoded at 320, and ended up with 276.
    Is there a utility to do an analysis on the existing 320 files to determine what the actual encoding is? Perhaps iTunes doesn't correctly display the actual bit rate, but rather what my custom setting was. That would be consistent with itunes get info not even showing VBR in the get info window too.
    Thanks,
    Jeff
    G4, 1.4 GHZ, Mac OS X (10.3.9)

    Hi NoName,
    Thanks again. Okay, I looked at the properties and it’s the same as the status bar, 320 k. I appreciate your continued insight and effort and will have to defer trying to figure this out. Only because in the past month I went ahead and migrated much of my CD library onto disk using the iTunes custom settings.
    I was decisive about using VBR, rather then CBR, for compatibility reasons. BarbaBatch, if you’re not already aware has a robust conversion set offering both VBR and CBR. My decision was based on using 320 because it sounds warmer to me then 192 or 256 at times.
    I also decided to use iTunes for workflow purposes. With iTunes, all I have to do is insert the CD and wait for it to Eject. Not bad for ripping 200 CDs to disc. Knowing there are actually better converters out there, well they don’t ‘get track names’ and compile everything into organized folders, and eject the CD, like iTunes. So it was a workflow over quality conversion, which I’m still happy with. Contrary to common concerns, I’m not the least bit concerned about disc space. I would just purchase another Drive!. Also, I used VBR knowing it creates smaller file sizes and found anomalies when not using VBR on 320. At times I would get a compressed sound without VBR. So it worked to some advantage. I realize this is the point in our thread where things become subjective too. If I had a couple of terabyte discs, and was picky enough, I’d keep the audio files in their native 16 bit format.
    Back to the original concern, I’m just wondering if what I’m experiencing is normal, and it’s all about how iTunes creates tags. They’re just too general, not showing me what the ‘actual’ bit rate is.
    Thanks and good luck with your work over there. It’s sounds like we are both Mac and PC’s users, so your recommendation about foobar is helpful and when I get more time I’ll obtain some of the other plugins that might be helpful in analyzing the files.
    Jeff
    G4, 1.4 GHZ, Mac OS X (10.3.9)

  • HDV Workflow -- What's wrong with this picture (other than some obvious)

    Hi Powerusers,
    I have a client with a canon XH-A1, they are ingesting via iMovie HD, cutting a rough timeline in iMovie, and then porting to FCP (via drag and drop) for me to finish on. Seems plausible all editing via AIC (apple intermediate codec). Final destination will be SD DVD, WEB, Handheld media, etc. Am I missing something or is this somewhat acceptable (other than loss of timecode) which they aren't concerned about since it's pretty lo-budget.
    Is editing using the AIC horrible (picture looks acceptable). I'm not used to this workflow. I work in DV, SD or DVCPROHD codecs/timelines but am baffled by not being able to ingest directly from Final Cut with this Canon HDV camera, but iMovie has that flexibility (view, start, stop, import) whereas I'm not getting any options other than capture now with FCP.
    Thoughts, criticisms, advice greatly appreciated.
    cheers

    I ended up capturing via FCP using HDV1080i60 easy setup with capture setting working with both Sony HDV over firewire and HDV Firewire Basic.
    Seems like all is working well using this setup. It's far more than the client needs as we'll be downconverting the timeline to SD once complete, but good enough now for edit. HDV is not fun to work with I'll tell ya. Still having some errors with log and capture.

  • What's wrong with this picture? Alerts on Mobility 2.1

    Never used Mobility service or its predecessor.
    Brand new Mobility Service 2.1 server running against GroupWise 2014.
    Created with the latest build of 2.1 (service-2.1.0-x86_64-230.iso)
    VM configuration: Four vCPU, 8GB RAM, 50GB disk
    The GW 2014 server and the Mobility server are both hosted on the same hardware; a Dell PE720.
    The respective storage is on 2 different SAN arrays.
    The Mobility system has a grand total of 7 users and 3 associated devices, yet I'm seeing the following alerts:
    Caution 3/6/2015 18:51 Time to Process GroupWise Events: It is taking a long time to receive events from GroupWise - GroupWise Sync Agent
    Caution 3/6/2015 18:51 Time to Receive Events from POA: It is taking a long time to Receive Events from POA - Device Sync Agent
    Caution 3/7/2015 15:56 Time to Process GroupWise Events: It is taking a long time to receive events from GroupWise - <user6>
    Caution 3/7/2015 23:54 Time to Process GroupWise Events: It is taking a long time to receive events from GroupWise - <user3>
    Caution 3/9/2015 08:58 Percentage of Events that are Slow (Full Time): Some events are taking an excessively long time to be processed - Device Sync Agent
    I'd like to note that user6 hasn't yet connected and registered a device on the system.
    If I'm getting time-related errors with a measly 7 users and 3 devices, I can't imagine what will happen with 100 users.
    What should I look at to track down the cause of the issues?

    gathagan wrote:
    > If I'm getting time-related errors with a measly 7 users and 3 devices, I
    > can't imagine what will happen with 100 users.
    Part of this is also merely "informational". When you first prime an account it
    will almost ALWAYS complain about high usage of attachments, time lags, and
    such. I generally do not worry about it unless these errors persist. And they
    will stay on the screen until you clear them. So are these errors "current", or
    historical at this point?
    Danita
    Novell Knowledge Partner
    GroupWise Mobility Service 2.0 Guide - http://bit.ly/1cv13RE
    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...
    Are you a GroupWise Power Administrator? Join our site at
    http://www.caledonia.net/register

  • TS1702 have apps loaded but no sound. Games work just  no sound. What is wrong with this picture?

    I have loaded some apps that work just fine while others have the game and work but no sound. What should I look for to fix this. I have deleted them and reloaded them but still no sound.
    Thanks

    Yes if I unplug the internet cable I can login.  That is however what I am trying to get across.  That is unacceptable by any standard.  Why should I have to unplug the dang internet to login to my router!?!?
    Browser does not matter.  They all give the same error.  If I reboot the router there is about a 20 second window where the login page will appear and give me the option to login local, but once I logout of that session its back to "502 Bad Gateway".  How can this **bleep** get past QA?
    I mean as a home user or business user I feel this is just garbage.  I can't login to he router without jumping through hoops.  I fell like an idiot telling the customer "Sorry due to a bug with this router I have to halt your business for a few minutes while I setup a port forward."  One of them even told me, so get me a different router, because we can't be doing that each time we need to make a change.  And I did.
    Basically I will never suggest these routers to anyone till this is fixed.

  • What's Wrong with This Picture?

    Several years ago, I copied my old Appleworks folder out of my upgraded G3 beige system that originally came with OS 8.1, that I'd updated through 8.6 to 9.0, 9.2, Panther and finally an XPostFacto install of Tiger.
    Since I have four drives in my Mac Pro, I tucked it away on one of the spares and it has weathered upgrades from the original install of Tiger that came with the Mac Pro through 10.5 to Snow Leopard. Now I just read a brody's migration tip page on AppleWorks, but THIS is leaving me scratching my head!
    Pay attention to the Get Info window.. and note that stylin' platinum starting
    points window!
    http://home.comcast.net/~foodandart/WhatsWrong.jpg
    This is the classic application - the FIRST copy I got in the fall of 2000 - and upgraded to 6.2.8 (which does not run), then to 6.2.9. The "-OLDAW6-" was what the update left in the folder afterwards. Now this classic app is running in Rosetta and only thing that crashes is the painting tool.
    I guess the 64 thousand dollar question is how much more classic code is capable of running, but for it not getting somehow changed along the way like this program did? How is it that the program icon doesn't have the grey 'prohibited' symbol across it like every other classic app on my system does and WHY - here's the REAL brain-melter - can I transfer this to the G4 jukebox in my living room and have it work without the missing data-fork problems like every OTHER classic app I have that has been hit by Snow Leopard ends up with?
    Weird.

    You are not running it in Classic - that's impossible under Snow Leopard. Your version of the application is 'Universal', running either under Classic or OSX (PPC, so Rosetta is required). The installer for that version was Classic only, oddly enough, but copying the folder as you have done will install it on OSX.
    As to why Paint is crashing, that's a separate issue. You could try deleting the preference file - (user)/Library/Preferences/com.apple.appleworks.plist and the AppleWorks User Data folder in your Documents folder.
    It might also be worth updating to version 6.2.9:
    http://support.apple.com/downloads/AppleWorks6_2_9_forMac
    This is pretty stable on Snow Leopard, though minor bugs seem to be creeping in with each System upgrade.

  • HELP!  I deleted my ipad email and re entered it and now I can't get any email?  What's wrong with this picture?

    i was was having problems with email and thought let's start from beginning so I dumped my email account which is att using yahoo and this morning I can't get any of my emails or send email,  anyine have any ideaS? 
    <Email Edited By Host>

    What email app are you using: ios mail or yahoo mail app?  You could try switching your email app.
    My yahoo mail app wouldn't accept my password for my id a few days ago.  I have not sorted it out yet.  Happened after I download a new version of the yahoo app.  Waiting for a new version of the app.  Reading my mail on my laptop instead.
    Robert

  • I'm using Safari 1.3.2!  :D  What's wrong with this picture?

    Well, yesterday I installed Safari 4 on my PC. Nice!
    WHY CAN'T I DO THAT ON MY MAC!
    Isn't this either hilarious or insane? I thought maybe I'd install S4 on the Mac but thought I might not be able to because I'm not running Leopard (or even Tiger). I was right! But I thought I'd see a link for "Older versions" or "Earlier OS". I was wrong!
    I went all through the download pages looking for a newer Safari that I could put on my Panther machine. No such luck!
    Isn't this silly? What can I do? TIA for assistance.

    Thanks to all of you for your responses. Camino is my default browser and has been for some time. I'm running the newest version. I expect to check out Firefox 3 sometime soon though. We'll see how that goes.
    Of course, discovering that I'm in a Mac cul-de-sac and that if I want Apple software I had better be running Windows are two sobering realizations.
    I paid 8x as much for the Mac as I did for my PC! And Apple does more for my PC today than it does for my Mac.
    And despite that, I still want to know if I can use Leopard Assist to install on my machine, which is listed as "uncertain" here:
    http://mac.profusehost.net/leopardassist/overview.html
    But that question belongs in a different forum.

  • What's wrong with this picture (unbundle display glitch)?

    Let me state first that I actually like the look of what I am going to show you, and I am tempted to suggest it as an actual feature...
    In any case, here it is:
    This is an unbundle node in an actual diagram. All items are connected. I was simply hovering over them to better read the name of the objects (white on a darker background is easier on my eyes than a pale orange on a white background) and as I was doing so, I noticed that if I lingered long enough and at the right location on an item, it would remain highlighted when I moved to the next one. This is how I generated the situation above (it took me some time to get it right, but that is not too difficult).
    Note that I am not activating the wiring tool (BTW, I have autotool off), I am just hovering with it over the unbundle node.
    All my drivers are up to date (including video drivers). Tested in LV 2011, Windows XP.

    This is probably the same display issue which was discussed here - http://forums.ni.com/t5/LabVIEW/Property-node-inverted-color/m-p/871556#M394578
    As long as it's not doing anything bad, it doesn't really bother me.
    That said, I don't remember seeing it in a long time, so it's possible that this stopped happening for me in LV 2009 (unlikely) or that it was an issue with the video driver on my previous laptop.
    Try to take over the world!

  • HT3209 My Computer supports all of the requirements, plus I use Apple TV, iPhone4s, and the New iPad (dumb name by the way) and it still won't allow me to download HD Movies. What is wrong with this picture?

    Why is that my PC supports all of the requirements for HD video but iTunes won't allow me to Download HD Movie. I am able to handle some of the most intense PC Games and I have HD movies Downloaded from previous versions of iTunes that work just fine. This is just stupid that iTunes thinks it knows my Computer's capibilities better than I do. Is there a way to change it?

    Hi,
    At the top of any Buddy List it will show Your Name or your Handle (Screen Name)
    This can be changed if you click on what is shown currently and it will become a drop down.
    Pic
    The "Name" is taken from the Mac User Account that is logged in and the My Card in that Address Book.
    So if this is your New Macbook Pro then Open the Address Book (Presumably there is only one Mac User account on this computer at the moment) and find the My Card (Head and Shoulders iCon)
    Make sure the details are yours.
    If the details are your brother's (Migrated info ?) then find your card and then go to the Card Menu and the option "Make this My Card".
    When Adding and @mac.com name to iChat 6.x the server for the AIM login should read api.oscar.aol.com
    The port likes to be port 443 with SSL ON  (See Sever Settings tab in iChat > Preferences > Accounts)
    Try it without SSL
    NOTE:  Despite the Add screen saying @Mac.com the account can get listed in the Accounts List as a MobileMe account.
    I would check that the original computer or the current one is not set to allow only one Login.
    9:44 PM      Saturday; November 26, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Extending Wireless Coverage; What's wrong with this picture?

    I would like to extend the coverage of my home WiFi network. I have an Airport Extreme 802.11n+Gigabit Ethernet as my central router which connects to my cable modem.
    Unfortunately I don't have a couple of Airport Express gadgets handy to extend my Airport/WiFi coverage. My house/etc is very long and narrow, so one Airport is not going to cover everything.
    I do have a couple of other WiFi routers that should be able to function as WiFi access points to extend Internet WiFi access to my Office and Winery; a NetGear and a SMC 2804WBRP-G.
    It seems that I should be able to set these two gadgets up two different ways that should work
    to extend my WiFi coverage.
    1) I should be able to connect one of these routers WAN port via ethernet to my Airport router (which routes/DHCP/manages the subnet 192.168.1.1/255.255.255.0) and have it route/ DHCP/ manage a separate subnet 192.168.2.1/255.255.255.0) Each WLAN would route a separate subnet, and use DHCP to assign addresses to computers that appear on their subnet, and route Internet traffic back to the main AirportEx router. But this doesn't seem to work.
    2) I should be able to disable DHCP on the secondary router, and only have the Airport hand out IP addresses. I should be able to disable routing, connect the Airport to the second router through one of the second routers LAN Ethernet ports, and have one subnet that covers all my local Ethernet and WiFi networks. But this doesn't seem to work either! Perhaps disabling routing on the second router isn't even necessary?
    Any Ideas? Thanks, Jim!

    2) I should be able to disable DHCP on the secondary router, and only have the Airport hand out IP addresses. I should be able to disable routing, connect the Airport to the second router through one of the second routers LAN Ethernet ports, and have one subnet that covers all my local Ethernet and WiFi networks.
    That certainly should work. Once the DHCP service is disabled on the router, you should be able to connect ANY of the router's Ethernet ports to one of the LAN ports on the AirPort Extreme base station (AEBS). Once configured this way, that router should be essentially a wireless bridge. Of course not all routers actually support this ability.
    What happens when you try this?

  • What's wrong with this picture?Can't find where it

    I can't find my picture
    It at what page? How do I delete it
    The file is here picture ID-CS6.zip_

    What happens when you click the "Go To Link" button?

  • What's wrong with this (transparent) picture ...?

    There are many posts on the issue of JPG's being converted into PNG's and a variety of replies with sympathetic suggestions for how to avoid this plague.
    Many months back I also used to see recommendations of making an iWeb graphic into a very reduced opacity item that can be used as a hyper-link.
    But I've yet to see any of the responders directly address the dreaded png's of transparent hyperlinks.
    Why not.?
    What's wrong with this picture.?
    Am I, so far, only partially educated about file type as to be unreasonably anxious about transparent hyper-link png's.?
    Has this graphic question just slipped through the cracks because of all the other jpg-into-png avoidance issues.?
    Or perhaps, do transparent png's "work-just-fine, thank-you" on a PC's I.E...?
    Is it somehow possible to reduce the opacity of an imported JPG without it converting..?
    If png's are to be avoided for any of us aiming at the-world-beyond-Mac, then that ought to include the iWeb graphics used for hyper-Links, right.
    What is the story..?
    Any help appreciated appreciated.!

    Nope… it'll more than likely be a problematic G5 software installation. My Mac mini runs a 24" display and can play 720p video just fine with it's extremely crappy Intel GMA950 integrated graphics. It does however frame drop a little with 1080i high motion video. Both Bluetooth and USB mice just work fine. The Mac Pro will have no problems doing any of this.

Maybe you are looking for

  • Creative cloud subscription without internet access

    Would there be a way to get the creative cloud subscription for my work with out using the internet monthly by paying the year in full. My workstation is not online and can't be, it is part of a internal network.

  • 57 Days and counting - Photo Stream grayed out on iCloud CP

    57 Days andcounting since problem first discussed with Apple. No help, just reported tosoftware engineers for investigation. Almost two months ago! So much forApples' superior products and customer service. Photo Stream works finebetween 2 iPhone 4Ss

  • Iphone not working after update to 3.1.3 firmware

    Can someone help?I purchased iphone in USA (I live in U.K.)Got it to work in U.K. on O2 using correct sim, etc. Updated to firmware 3.1.3 now all I get when I enter iTunes is a message "The sim card inserted in this iphone does not appear to be suppo

  • Server unable to read client's certificate.

    Thanks for reading. Hope you can provide me an answer. Keystore - created through pfx file, a file that exported from server keystore, .jks. Truststore - a jks file that contain a .cer, a file that exported from server keystore, .jks. Problem - x509c

  • Where can I find a healthy Apple message board

    Please direct me to a positive but honest Apple message board re the stock AAPL.