First, simplify the given equation using the identity for the dot product: \[ (\vec{a} - \vec{b}) \cdot (\vec{a} + \vec{b}) = \vec{a}^2 - \vec{b}^2. \] Thus, the equation becomes: \[ \vec{a}^2 - \vec{b}^2 = 512. \] Next, we use the condition \( |\vec{a}| = 3 |\vec{b}| \). Let \( |\vec{b}| = x \), so \( |\vec{a}| = 3x \). Therefore, we can rewrite the equation as: \[ (3x)^2 - x^2 = 512 \quad \Rightarrow \quad 9x^2 - x^2 = 512 \quad \Rightarrow \quad 8x^2 = 512. \] Solving for \( x \): \[ x^2 = \frac{512}{8} = 64 \quad \Rightarrow \quad x = 8. \] Hence, \( |\vec{b}| = 8 \) and \( |\vec{a}| = 3 \times 8 = 24 \).