There are only a handful of places you can get a legitimate copy of Avast, starting Here.
Whether you use the free (Home) version or purchase the Pro, the key would be emailed to you by the company at the email address you used.
Any other method of obtaining a key is not legitimate.
It is also possible your actual setup file for Avast is not legitimate, depending on the source. It would be worth checking.