Paypal, encrypted add to cart button generate dynamically
Your question embodies a contradiction in terms. The purpose of so-called encrypted buttons is for Paypal to check that they exist as registered buttons. If you roll your own buttons, Paypal can't do that.
You're looking at the problem the wrong way. If someone chooses to send you money, that's very nice, but unless it's a price you recognize and advertise for one of your own items, you're not obliged to deliver anything. Your IPN handler should check that and fail the transaction if the price, item, etc. don't match your own catalog database.
You can either refund the money or even just let Paypal's normal processes do that for you if they have the cheek to raise an 'item not received' case. Or just keep it as a donation.
in my current web application project, I'm developing a small commerce with many products... 
I need to implement PayPal for payments and I have read a lot of documentation in paypal developer site.
The solution of implement Payment standard Buttons (add to cart button in my case) is fantastic, but I need to auto generate the html for each product in my database.
If I auto-generate the clear code (without encryption) the problem is that one malicious user can edit the amount of one product (in html rendered page) and the purchase it (with your price :D )....
What I want is to auto generate the encrypted "Add to cart" button with some APIs.
What is the elegant solution to my problem??
I'm using python for develop my application.