Most racks have a platform about 3"-4" wide and about 12" long. Usually 20 pounds is well within the weight limits. This means that weight isn't an issue, but keeping the item steady is. Your package needs to be fairly stiff for this to have any hope of working, since the rack platform is so much smaller. A porteur-style large-platform front rack or a trailer would probably be better than a normal back-rack.
First recommendation: take a friend. This will be hard to attach with a kickstand holding up your bike (or the bike leaned up against something). It'll be easier if the bike is held straight upright and if you only have to wrestle one thing at a time.
I would place it so that it's low and is "wider" rather than "longer". There seems to be a natural tendency to want to line up more with the rack, but in my experience that's actually less stable because so much hangs off of the back.
In other words, 12" as the "height", 18" as the length and 28" as the width.
It's likely that this is tall enough to bump into the seat, so it'll tend to be right behind the seat, which may mean you can't quite use all of the rack platform.
I would use compression straps or bungee cords, rops knots take too much technique and time to pull tight and if it's loose or can slip loose it will wobble too much. If it's straps you want something that has a buckling mechanism that you can pull tight and locks up well. If it's bungees you'll want to work out what the reasonably-stretched-out length is (usually about 50% more than the unstretched length).
Exactly how to hook things will depend greatly on the exact details of your rack construction, but there's always some way to hook things on.
Straps: 2 over 62" long, and 2 over 80" long. Likely that 6' and 9' are the lengths you can find. Basically, long enough to go around the box front-to-back and side-to-side, with a little extra for going around some of the rack stuff and for pulling stuff tight.
Bungees: 2 with a reasonably stretched length of about 46" and 2 with a reasonably stretched length about 76". (or combine bungees together).
Using the shorter straps or bungees, go from the front left of the rack to the back left of the rack with one, and front right to back right with the other. If the bungee is a little too long, try running through the rack and attach to the seat stay or something like that. If you've done things right at this point, you should find that pressing on the far right or far left stretches the other bungee enough that there's a decent amount of resistance and the package snaps back. It's important that these two be the same tension.
Then run straps or bungees left-to-right around the package at the front and back of the rack. If the "front" is too close to the front of the package itself slide it back a little as appropriate, of course. It's okay if these two are a little different in tension.
Essentially, I'm suggesting you run one strap/bungee on the right side like this:
One strap/bungee on the left side like this:
One left-to-right around near the front of the rack like this:
And one left-to-right nearer the rear of the rack (no picture).
Believe it or not, just both front-to-back bungee runs or the frontmost left-to-right bungee run is quite secure already, because any attempts on the part of the package to twist out of alignment mean stretching the bungee further. Combining both means it's also impossible for the package to slide out of the bungees.
I would avoid any diagonal strap/bungee runs, those will tend to pull the package twisted which is less stable.